CompuServe Thread

#Another question

2 messages in this thread
#45896From: Christian BennerFeb 27, 1995 12:37 PM
Hello, a question again. What`s the best method if I have a string like this: "Charlie is going into a bar" and I would change only the "b" to a "c" ? Thanks for any help Chris Known as: SYSOP@apd.insider.sub.de 8.5 GBytes Online Christian_Benner%2:245/6613.8 Mailbox: +49 6384 7582
#45931From: Peter WadeMar 1, 1995 6:06 PM
You can use the function strchr to find the first occurence of a character in a string. In your example : ptr = strchr ( string, 'b' ) ; if ( ptr ) *ptr = 'c' ; where string is a pointer to your text string and ptr is pointer to a character. Peter Wade Autopiloting from London, England