Results 1 to 3 of 3

Thread: String manipulation

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    92

    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.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169

    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

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    3) fscanf() can do that
    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
  •  



Click Here to Expand Forum to Full Width