JavaScript String object
JavaScript String refers to complete string object reference of the string. In string object all properties and method can be use to manipulate to the string. String object contain complete information about string.
Example
In following example we are using toUpperCase properties of string object.
<html>
<head>
<script type="text/javascript">
function test() {
var str = "welcome";
document.write(str.toUpperCase());
}
</script>
</head>
<body>
<button onclick="test()">
click</button>
</body>
</html>
|
Output
In fowling example we are using Length method of string object.
<html>
<head>
<script type="text/javascript">
function test() {
var str = "welcome";
document.write(str.length);
}
</script>
</head>
<body>
<button onclick="test()">click</button>
</body>
</html>
|
Output
Further Readings
You may also want to read these related articles: here
Ask Your Question
Got a programming related question? You may want to post your question here