Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2008, 11:36 PM
Authorized User
 
Join Date: Aug 2006
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default remove commas and space in a string

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

 
Old January 10th, 2008, 11:42 PM
Friend of Wrox
 
Join Date: Oct 2007
Posts: 130
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via AIM to urtrivedi
Default

use split function, it will return array of words
str=apple, orange, mango

arr=split(str,",")
array will have three items, you can trim content using for loop
array content
arr(0)=apple
arr(1)=orange
arr(2)=mango

arr.length=3

urt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove orphaned html elements from html string pauliehaha C# 2008 aka C# 3.0 2 June 30th, 2008 09:40 AM
Remove the unwanted space at end of the string gmbalaa General .NET 2 August 21st, 2007 11:35 PM
Replace or remove the last char from the string sabu21s XSLT 12 January 8th, 2004 05:26 PM
How to read a string with a space? megabytes C# 4 August 1st, 2003 03:26 PM
Remove Space from table records mateenmohd SQL Server 2000 1 July 20th, 2003 06:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.