JavaScript String Function
Almost every language provides special attention towards string and string manipulation, JavaScript is no exception. It provides many built-in functions to manipulate a string.
Java String Function Example:
<html>
<head>
<script type="text/javascript">
document.write("<b/>Length of the String is:</b><br/>" );
str="This is a string";
document.write(str.length);
document.write("<br/><b/>Lowercase of the string is:</b><br/>" );
str="THIS IS IN LOWERCASE";
document.write(str.toLowerCase(str));
document.write("<br/><b/>Uppercase of the string is:</b><br/>" );
str="this is in uppercase";
document.write(str.toUpperCase(str));
str1="Wel";
str2="Come";
document.write("<br/><b>After concatanation the string is:</b><br/>"+str1.concat(str2));
</script>
</head>
</html>
Output:
Length of the String is:
16
Lowercase of the string is:
this is in lowercase
Uppercase of the string is:
THIS IS IN UPPERCASE
After concatanation the string is:
WelCome