1// how to remove particular character from string
2public class RemoveParticularCharacter
3{
4 public static void main(String[] args)
5 {
6 String strInput = "Hello world java";
7 System.out.println(removeCharacter(strInput, 6));
8 }
9 public static String removeCharacter(String strRemove, int r)
10 {
11 return strRemove.substring(0, r) + strRemove.substring(r + 1);
12 }
13}
1// remove last character from string in java
2public class SubstringDemo
3{
4 public static void main(String[] args)
5 {
6 String strInput = "Flower Brackets!";
7 String strOutput = strInput.substring(0, strInput.length() - 1);
8 System.out.println(strOutput);
9 }
10}
1# subString(int start, int end);
2
3String a = "Hello!";
4b = a.subString(0,a.length()-1) #Remove the last String
5# b should be "Hello" then
1if(String.charAt(1) == String.charAt(2){
2 //I want to remove the individual character at index 2.
3}
4