you can do mostly everything VB can do in JS (as far as web pages are concerned).
to check the length of a string you can do :
var myString = "this is my test string"
alert(myString.length)
Also if you have a string like this one "test,test,test,test" you can change it to an array using split(',') and remove the last element in it.
var myString = "test,test,test,test";
alert("my original string " + myString)
var myArray = myString.split(',')
myArray.pop(); // removes the last element of my array
myString = myArray.join(','); // creates a coma delimited string
alert("now my string with the last element removed " + myString)
Does this help you out? Gary
Haran