|
-
Oct 28th, 2002, 03:07 AM
#1
Thread Starter
Lively Member
String manipulation
Hi !
the following are need to be in C:
I look for some functions that do the following and i don't know how to do it:
1. spilt a string by some delimiter .
2. find the first occurence of some char in a string .
3. how can i read from a file , word by word in a given line.
4.cut the edges from left/right from a word
5. where i can find any methods that work on string.
Thanks.
-
Oct 28th, 2002, 03:45 AM
#2
Monday Morning Lunatic
Re: String manipulation
Originally posted by Anavim
Hi !
the following are need to be in C:
I look for some functions that do the following and i don't know how to do it:
1. spilt a string by some delimiter .
2. find the first occurence of some char in a string .
3. how can i read from a file , word by word in a given line.
4.cut the edges from left/right from a word
5. where i can find any methods that work on string.
Thanks.
1. strtok()
2. strchr()
3. Use fopen(), fgetc(), and check for spaces
4. Search the forums, people have posted trim functions
5. You mean a C++ string?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 28th, 2002, 05:50 AM
#3
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|