js get first letter of string
var x = 'some string';
alert(x.charAt(0)); // alerts 's'
js get first letter of string
var x = 'some string';
alert(x.charAt(0)); // alerts 's'
javascript indexof
//indexOf getting index of array element, returns -1 if not found
var colors=["red","green","blue"];
var pos=colors.indexOf("blue");//2
//indexOf getting index of sub string, returns -1 if not found
var str = "We got a poop cleanup on isle 4.";
var strPos = str.indexOf("poop");//9
get index of first number in string javascript
var str = "Se7en";
var search = str.search(/\d/);
console.log("first digit at: ", search); // first digit at: 2
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us