This example uses the string functions.
<HEAD>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Chew(theString)
document.write "<BR>The leftmost 3 characters are <I>" & Left(theString, 3) & "</I>"
document.write "<BR>The rightmost 3 characters are <I>" & Right(theString, 3) & "</I>"
document.write "<BR>The middle 3 characters are <I>" & Mid(theString, (Len(theString)/2) - 3, 3) & "</I>"
End Sub
-->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="VBScript">
<!--
document.write "<B>You're so ugly</B>"
Call Chew("You're so ugly")
document.write "<P><B>I could press your face in dough</B>"
Call Chew("I could press your face in dough")
document.write "<P><B>and make gorilla cookies!</B>"
Call Chew("and make gorilla cookies!")
-->
</SCRIPT>