Usage | Returns |
---|---|
String.index(pattern) | Integer |
Argument | Type | Details |
---|---|---|
this: target | String | The string to search. |
pattern | String | The string to find. |
Examples
Code Editor (JavaScript)
print(ee.String('abc123').index('')); // 0 print(ee.String('abc123').index('c1')); // 2 print(ee.String('abc123').index('ZZ')); // -1