...

View Full Version : remove commas and space in a string



cloudy
01-11-2008, 04:37 AM
hi..i need some help...

let say i got a string:

apple, orange, durian

question:

1. how to check got how many commas in this string?
2. how to check beside the commas is space or not space?
3. if the words beside the commas is space, i wan to remove the space?
4. if the words got commas, i have to remove the space


i need help ..urgent..plz help..thanx

Spudhead
01-11-2008, 11:15 AM
<&#37;
strWords = "apple, orange,durian"
strWords = replace(strWords, ", ", ",") ' replace comma+space with just comma
aryWords = split (http://www.devguru.com/technologies/vbscript/13973.asp)(strWords, ",")
for i = 0 to uBound(aryWords )
response.write("<br/>" & aryWords(i))
next
%>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum