M
Melroy
sorry for the naive question, as I am new to C. But is there a simple
and elegant way to replce parts of a string (if one knows the start
position and number of characters)
with something else?
in other words, if
string1 = "Hello World"
I want to replace the 3rd and 4th characters (In this "ll") with "pp"
so that string1 = "Hepp World"
How does one do that? Is there I could not find it in the C FAQ on
the web.
(There is a way to extract parts of a string into another one which
is addressed in
http://c-faq.com/charstring/substr.html)
but not what I am trying to do (which is sort of reverse that)
Thanks very much
and elegant way to replce parts of a string (if one knows the start
position and number of characters)
with something else?
in other words, if
string1 = "Hello World"
I want to replace the 3rd and 4th characters (In this "ll") with "pp"
so that string1 = "Hepp World"
How does one do that? Is there I could not find it in the C FAQ on
the web.
(There is a way to extract parts of a string into another one which
is addressed in
http://c-faq.com/charstring/substr.html)
but not what I am trying to do (which is sort of reverse that)
Thanks very much