pos multimethod
Methods
- pos(haystack:Str, needle:Str, start:Int)
Find substring position Parameters
start Non-negative Int, position where the search starts Returns
Int or null. Not -1 as in many languages
- pos(haystack:Str, needle:Str) Source: stdlib.ngs:3266
Find substring in a string. Parameters
haystack The string to search in needle The string to find Returns
Int or nullExample
pos("abc", "cd") # null pos("abcdef", "cd") # 2