cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Search a string.
Search a string.
Oct 27, 2021 at 5:59pm UTC
Setat
(9)
Hi,
I need to find a string which is started from the first of the line and replace it with another string,
s1 = xxyyzz
xxyyzz = ...
s2 = ABCxxyyzzDEF
ABCxxyyzzDEF =...
s3= xxyyzzABCDEF
xxyyzzABCDEF = ...
I need to find just s1.
Although s2 and s3 are including s1, I do not need s2 or s3.
How I can write the code?
Oct 27, 2021 at 7:44pm UTC
jonnin
(11435)
string has .find() and .replace() ... just call them?
if you need to replace the same block many times, you can simply loop (using find) or rig up a complex statement.
Last edited on
Oct 27, 2021 at 7:46pm UTC
Topic archived. No new replies allowed.