Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get the first character of a string in javascript

let str = 'John Wick'
let firstChar = str.charAt(0) 
console.log(firstChar); // "J" 
Comment

first x characters of string javascript

let string = "abcdefghi"
console.log(string.slice(0, 3))
// abc
Comment

get first word of string js

let myStr = "Hello World"
let firstWord = myStr.split(" ")[0]
Comment

get the first word of a string javascript

let sentence = "The big brown fox"
let word = sentence.split(" ")[0]

console.log(word) // The
Comment

js get first letter of string

var x = 'some string';
alert(x.charAt(0)); // alerts 's'
Comment

get first 10 characters of string javascript

String.substring(0, 10);
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript get first 2 char 
Javascript :: jqiery call onclick in another element 
Javascript :: react native italic text 
Javascript :: self invoked function javascript 
Javascript :: How to find the max id in an array of objects in JavaScript 
Javascript :: js loop ul 
Javascript :: a-z array javascript 
Javascript :: settimeout es6 
Javascript :: js onsubmit prevent default 
Javascript :: random date generator javascript 
Javascript :: header ejs 
Javascript :: event listener mousemove 
Javascript :: js search json 
Javascript :: javascript do arrays intersect 
Javascript :: js queryselector names 
Javascript :: js localstorage boolean 
Javascript :: select all children javascript 
Javascript :: button click redirection to another page vue 
Javascript :: how to insalk react router with npm 
Javascript :: raspberry pi install node js 
Javascript :: javascript add string inside foreach 
Javascript :: error java.io.filenotfoundexception tessdata/eng.traineddata 
Javascript :: javasctipt unix timestamp from date 
Javascript :: generate random number nodejs 
Javascript :: ajax download file 
Javascript :: how to add two number using jqueryu 
Javascript :: js shuffle array 
Javascript :: jquery get class name 
Javascript :: javascript generate random number based on date 
Javascript :: how to set form control value in angular 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =