Java Code to Delete Specific Character from the end of String
Java Code to Delete Specific Character from the end of String
import java.lang.*;
import java.io.*;
import java.util.*;
public class Test
{
public static String nop(String x,int y)
{
String ans = x.substring(0,x.length()-y);
return ans;
}
public static void main(String[] args)
{
System.out.println(nop("IOP12345ABC",2));
}
}
Output
=======
IOP12345A
Comments
Post a Comment