Answers for "how to delete string substring"

0

how can I delete a substring from a string in c++?

string x = "Iron Man";
x.erase(start,length);
cout << x;
// start represent from which position we try to delete
// length rerensent the length we try to delete from the start position.
Posted by: Guest on November-08-2021
0

remove part of string java

// Works only if you have a certain character at which you want to cut
String text = "Image.png";

String[] cutText = text.split("\\.");

// cutText[0] has value "Image"
// cutText[1] has value "png"
Posted by: Guest on March-11-2020

Code answers related to "how to delete string substring"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language