JavaScript String Object
Let's take a look at an instance of the length of the returned character.
<body>
<script type= "Text/javascript" >
var txt= "Hello world!";
document.write (txt.length);
</script>
</body>
Result is 12
Let's look at an example.
The IndexOf () method
How to use the IndexOf () method to return the position of the first occurrence of the specified string value.
<body>
<script type= "Text/javascript" >
var str= "Hello world!";
document.write (Str.indexof ("Hello") + "<br/>");
document.write (Str.indexof ("World") + "<br/>");
document.write (Str.indexof ("World"));
</script>
</body>
Okay, let's take a look at a simple introductory tutorial on JavaScript string pairs.
Full string Object range
For a complete reference of all the properties and methods that can be used with a string object, please give us a full range of string objects.
Mention contains a short description and examples of each of the properties and methods used!
String Object
Stores a piece of text.
Use Example:
The following example uses a string object of length property to find the length strings:
var txt= "Hello world!";
document.write (txt.length);
Output Results 12
The string object is used to control a string object that uses the toUpperCase () method to convert strings to uppercase letters: var txt= "Hello world!";
document.write (Txt.touppercase ());
Output for big Hello world!