String Manipulation Functions: ============================== 1) charAt() 2) charCodeAt() 3) slice() 4) substr() 5) substring() Document
String Conversion
=========================================== indexOf() ========= ==> indexOf() can accept a character and return the index of the specified character. Syntax: str-object.indexOf(character) ==> if the specified character is duplicated (char at multiple places within the string): indexOf() can return the index of the first occurrence. ==> if the specified character is not present: indexOf() can return '-1' Document ===================================== lastIndexOf(): ============== ==> lastIndexOf() can accept a character and return the index of the specified character. Syntax: str.lastIndexOf(character) ==> if the specified character is duplicated: lastIndexOf() can return: character's the last occurrence index ==> if the specified character is not present: it can return -1. Document =================================================== Document
Email