Answers for "how to delete a part of string"

1

remove part of string python

txt = 'abbacabbd'
print(url.replace('bbd',''))

#output:
abbaca
Posted by: Guest on July-16-2020
0

delete parts of a string c++

#include<iostream>
#include<string>

using namespace std;
int main()
{
   string text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

   cout << "Initial string: " << text << endl;

   text.erase(10, string::npos);
  // string.erase(pos1, pos2) removes the part of the string between position 1 and 2.
  // In this case, between character 10 and the end of the string.

   cout << "Final string: " << text;
}
Posted by: Guest on July-19-2021

Code answers related to "how to delete a part of string"

Python Answers by Framework

Browse Popular Code Answers by Language