1//To delete starting from "opened"
2String str ="13 opened by someone";
3
4String result = str.substring(0,str.lastIndexOf(" opened"));
1String str = "abcdDCBA123";
2String strNew = str.replace("a", ""); // strNew is 'bcdDCBA123'
1
2String str = "abcdDCBA123";
3String strNew = str.replace("a", ""); // strNew is 'bcdDCBA123'
4
1// Works only if you have a certain character at which you want to cut
2String text = "Image.png";
3
4String[] cutText = text.split("\\.");
5
6// cutText[0] has value "Image"
7// cutText[1] has value "png"