Javascript Strings

Javascript Strings represents sequence of char. String is associated with string literal , Example :-“ tutorialworldin ”. In java script it is constant and it can not be changed.’-‘ operator is overloaded to concatenate two String operands ‘-‘. Java String class provides a lot of methods  compare(),  concat(), equals(), split(), length(), replace(),  compareTo(), etc.

<title>we are using javascript join method in this example</title>
var myarray = [“red”,”green”,”blue”];
var stringversion = myarray.join(“-“);
document.write(“result without join method = “+myarray+”<br>”);
document.write(“we are using join method in this result = “+stringversion);

Javascript Strings Result :-

result without join method = red,green,blue
we are using join method in this result = red-green-blue


Question :- Reverse String Function Example ?

Question :-  Slice function  with string ?

Question  : – to String Function Example ?

Follow Us

Contact Us

Back to Top