2.4.2 Searching Within a String
To find one string within another string, use the 'indexOf()' function. The 'indexOf' function returns the starting index of the substring within the parent string. If the substring is not found, it returns a value of -1. For example:
var state = 'New Jersey';
if(state.indexOf('New') > -1) {
Text1.text = 'With New';
}
else {
Text1.text = 'Without New';
}
| << 2.4.1 Changing a String to Upper/Lower Case | © 1996-2013 InetSoft Technology Corporation (v11.4) | 2.5 Useful Date Functions >> |