Can somebody give me sample technique to omit one character at particular index?
For example : String s = "Hello" and int Index 3 and it output is Helo
Can somebody give me sample technique to omit one character at particular index?
For example : String s = "Hello" and int Index 3 and it output is Helo
Utilizing the StringBuilder
class:
public static String deleteCharAt(String value, int index) {
StringBuilder result = new StringBuilder(value);
result.deleteCharAt(index);
return result.toString();
}