Search DaTutorials:  
HOME
VB Script Tutorials
Introduction
Reference
Tutorials

Get a substring

Description:


How to get a substring from a larger string.

Code:


<html>
<body>
<head>
<script type="text/vbscript">

function Substring()

 var1 = "abcdefghijk"
 var2 = Mid(var1,5, 3)
 document.write("var2="& var2 & "< br>")

end function

</script>

</head>
<body>
<p>
<script type="text/vbscript">
Substring()
</script>
</p>

</body>
</html>

See working example:


Keywords:

VBScript: function, Mid

DHTML: document.write


     Laptop PC | Adverse Credit Remortgage | Best Credit Cards | Loans | Loans
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp