Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is IstringMap interface the best to find a string in a list?
#9
foreach is fast.

Function SelStrInList
Code:
Copy      Help
;/
function# $sList $sFind [flags] ;;flags: 1 case insens

;Returns 1-based index of string in a list, or 0 if not found.

;sList - multiline list of single-line strings.
;sFind - string to find.


int i(1) ins(flags&1)
str s
foreach s sList
,if(!StrCompare(s sFind ins)) ret i
,i+1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)