• Member Avatar for Vishal_36
    Vishal_36

    Replied To a Post in Remove all occurrences of a string

    when the string s1 = "aabcbc" and s2 = "abc" why after performing operations my s1 string is not null? is i am doing something wrong?
  • Member Avatar for Vishal_36
    Vishal_36

    Began Watching Remove all occurrences of a string

    Hello everyone, I have a code that use function to find and remove all occurrences of a string within a string (substring pending) and return the number of removals: I …
  • Member Avatar for Vishal_36
    Vishal_36

    Gave Reputation to Ancient Dragon in Remove all occurrences of a string

    try this: [code] string s1 = "abdxyzdxyz"; string s2 = "xyz"; size_t pos; while( (pos = s1.find(s2)) != string::npos) { string s3 = s1.substr(0,pos); if( (pos+s2.length() + 1) < s1.length()) …
  • Member Avatar for Vishal_36
    Vishal_36

    Gave Reputation to Ancient Dragon in Remove all occurrences of a string

    try this: [code] string s1 = "abdxyzdxyz"; string s2 = "xyz"; size_t pos; while( (pos = s1.find(s2)) != string::npos) { string s3 = s1.substr(0,pos); if( (pos+s2.length() + 1) < s1.length()) …

The End.