i\'m doing something like excel, i have something like this:
1 2 3
A1 B1 C1
where it replaces the content for
Any time you run into some string manipulation problem in C, your first instinct should be to look at string.h
and see what's available there. As outlined in several answers here, there is no function to do string replacement directly, but it should be possible to use strstr
and strncpy
to find occurrences of substrings and then copy the replacement (into a new buffer so as not to clobber the rest of the original, obviously).