Every line of 'last occurrence of a character in a string javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
59 get prevChar(): number { 60 return this.position - 1 >= 0 ? this._text.charCodeAt(this.position - 1) : 0; 61 }
395 function previous(): string { 396 return source.charAt(currentIndex - 2) 397 }
67 lookAhead(offset: number): number { 68 const pos = this._position + offset; 69 return pos < 0 || pos >= this._text.length ? 0 : this._text.charCodeAt(pos); 70 }
200 function char_(str, i) { 201 return str.charCodeAt(i); 202 }
140 function replaceLastCharacter(string, character) { 141 return string.slice(0, string.length - 1) + character; 142 }