programming-examples/java/Basics/How to remove a particular character from a string.java
2019-11-18 14:44:36 +01:00

9 lines
302 B
Java

public class Main {
public static void main(String args[]) {
String str = "this is Scanftree;;
System.out.println(removeCharAt(str, 3));
}
public static String removeCharAt(String s, int pos) {
return s.substring(0, pos) + s.substring(pos + 1);
}
}