1.
Using the properties of a variable
<script type= "text/web Effects" >
var txt= "Hello world!"
document.write (Txt.length)
</script>
2.
Converts all letters in a string to uppercase letters.
<script type= "Text/javascript" >
var str= "Hello world!"
document.write (Str.touppercase ())
</script>
3.
JS in a variable to add a hyperlink
<script type= "Text/javascript" >
var txt= "Hello world!"
document.write ("<p> hyperlink is:" + txt.link ("http://www.w3school.com.cn") + "</p>")
</script>
4.
The IndexOf method, where the first occurrence of a specified character in a string is positioned. If you do not find the return-1, case-sensitive
<script type= "Text/javascript" >
var str= "Hello world!"
document.write (Str.indexof ("hello") + "<br/>")//1
document.write (Str.indexof ("World") + "<br/>")//-1
document.write (Str.indexof ("World"))//6
</script>
5.
Match () method
Use Match () to find a specific character in the string and, if found, return the character.
<script type= "Text/javascript" >
var str= "Hello world!"
document.write (Str.match ("World") + "<br/>")//world
document.write (Str.match ("World") + "<br/>")//null
document.write (Str.match ("worlld") + "<br/>")//null
document.write (Str.match ("world!"))//world!
</script>