C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old February 25th, 2003, 12:51 PM
kalpana_kk kalpana_kk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 11 kalpana_kk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question split() function

I have a textarea and i have to enter a list of tickers like below.....

sss,ffff,gggg,ttttt

(here the count is 4)
then later they have to be written on a file.

the thing is.....

if i have a record something like below....

sss,,fffff, ,gggg,tttttt,


then i have to remove the spaces,extra commas and it should return the count as 4.
if i use split function for the above record , i get the o/p count 6 which is not i watned.

i do i solve the above thing using split??

is there any other method???

Thanks in advance.
Kalpana

Reply With Quote
  #2  
Old February 25th, 2003, 02:45 PM
7stud 7stud is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2001
Posts: 1,327 7stud User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 44 m 50 sec
Reputation Power: 9
You could check each substring returned by split() and if it's a space, you could not count it or not write it to a file.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > split() function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway