|
Find
int
Find (string
string, int substring, int
startPos)
Return
Value
The zero-based index of the first
character in this string that matches the requested
substring; -1 if the substring is not found.
Parameters
string
– string to search in.
substring–
string to search
for.
startPos– the
index of the character in the string to begin the search with, or 0
to start from the beginning. The character at startPos is
excluded from the search if startPos is not equal to
0.
Remarks
Searches this
string for the first match of a substring.
Example
The following
example demonstrates the use of Find.
# Example for Find
strings
=
"Hello, World"
intiPos
=
Find(s,
"World",
0)
stringsWorld
=
Mid(s,
iPos,
Length(s)
- iPos)
Println("New
string is
",
sWorld)
Output of the example
script:
New string is World
|