Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

IndexOf: Difference between revisions

From Catglobe Wiki
Cg_pham (talk | contribs)
No edit summary
Cg_pham (talk | contribs)
No edit summary
Line 1: Line 1:
[[Category:String_Functions]]


 
==== indexOf ====


====indexOf====
Returns a 0-based index of the first occurrence of a string in another string. Returns empty if there are no occurrences found.


Returns a 0-based index of the first occurrence of a string in another string. Returns empty if there are no occurrences found.
'''Syntax'''


'''Syntax'''
indexOf(''stringToSearchFor, stringToSearchIn'')


indexOf(''stringToSearchFor, stringToSearchIn'')
'''Arguments'''  


'''Arguments'''
''stringToSearchFor'': is a string expression.


''stringToSearchFor'': is a string expression.
''stringToSearchIn'': is a string expression.  


''stringToSearchIn'': is a string expression.
'''Return type'''  


'''Return type'''
number


number
'''Example'''


'''Example'''
string 1 = "is";


string 1 = "is";
string s2 = "catglobe is tHe beSt";  


string s2 = "catglobe is tHe beSt";
number result =indexOf(s1, s2);  


number result =indexOf(s1, s2);
print(result);  


print(result);
//9


//9
'''Availability'''


'''Availability'''
Version 5.2 


Version 5.2
[[Category:String_Functions]]
__NOTOC__
<!-- imported from file: 687.htm-->

Revision as of 03:28, 14 December 2011



indexOf

Returns a 0-based index of the first occurrence of a string in another string. Returns empty if there are no occurrences found.

Syntax

indexOf(stringToSearchFor, stringToSearchIn)

Arguments

stringToSearchFor: is a string expression.

stringToSearchIn: is a string expression.

Return type

number

Example

string 1 = "is";

string s2 = "catglobe is tHe beSt";

number result =indexOf(s1, s2);

print(result);

//9

Availability

Version 5.2

Contents