|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > split() function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|