Answers for "javascript index string"

14

how to get the first character of a string in javascript

let str = 'John Wick'
let firstChar = str.charAt(0) 
console.log(firstChar); // "J"
Posted by: Guest on November-16-2020
12

javascript get first character of string

var str="Hello Folks!"
var firstStringChar = str.charAt(0); //H
Posted by: Guest on August-01-2019
3

js indexof string

const paragraph = 'The quick brown fox';

console.log(paragraph.indexOf('T'));
>> 0

console.log(paragraph.indexOf('h'));
>> 1

console.log(paragraph.indexOf('Th'));
>> 0

console.log(paragraph.indexOf('he'));
>> 1

console.log(paragraph.indexOf('x'));
>> 18
Posted by: Guest on October-22-2020
1

js indexof string

str.indexOf(searchValue[, fromIndex])
Posted by: Guest on July-10-2020

Code answers related to "javascript index string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language