Horje
javascript substr Code Example
js get first 3 characters of string
const string = "0123456789";
console.log(string.slice(0, 2)); // "01"
console.log(string.slice(0, 8)); // "01234567"
console.log(string.slice(3, 7)); // "3456"
js substring
// the substring method returns a string out of another string

const str = 'Mozilla';

console.log(str.substring(1, 3));
// expected output: "oz"

console.log(str.substring(2));
// expected output: "zilla"
sub function javascript
// Simple Substraction Function in Javascript
function sub(a, b) {
return a-b
}
console.log(sub(6, 2))
substring javascript
var str = "Hello world!";
var res = str.substring(1, 4); //ell
substr() javascript
const str = 'substr';

console.log(str.substr(1, 2)); // (1, 2): ub
console.log(str.substr(1)); // (1): ubstr

/* Percorrendo de trĂ¡s para frente */
console.log(str.substr(-3, 2)); // (-3, 2): st
console.log(str.substr(-3)); // (-3): str
javascript substr
str.substring(/* starting_idx */, /* number_of_values_to_get */)




Javascript

Related
javascript string insensitive compare Code Example javascript string insensitive compare Code Example
horizontal tabs in react js Code Example horizontal tabs in react js Code Example
olx clone react Code Example olx clone react Code Example
put logo in qr code in react js qrcode.react Code Example put logo in qr code in react js qrcode.react Code Example
make forn awesome icon clickable in react Code Example make forn awesome icon clickable in react Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10