string :A string can be any text inside double or single quotes:
let str = "hello world";
let str1 = 'welcomr to world';
String properties :
- Length : Returns the length of a string
var arr= 'hi this is ramesh'
var arr1= arr.length
console.log(arr1)
- constructor : Returns the string's constructor function
- prototype :Allows you to add properties and methods to an object
String Methods :
concat() Returns two or more joined strings
includes() Returns if a string contains a specified value
slice() Extracts a part of a string and returns a new string
replace() Searches a string for a value, or a regular expression, and returns a string where the values are replaced
slice() Extracts a part of a string and returns a new string
split() Splits a string into an array of substrings
substring() Extracts characters from a string, between two specified indices (positions)
toLowerCase() Returns a string converted to lowercase letters
trim() Returns a string with removed whitespaces