pastebin

Paste Search Dynamic
Recent pastes
subStr
  1. import java.io.*;
  2. import java.util.*;
  3. import java.text.*;
  4. import java.math.*;
  5. import java.util.regex.*;
  6. class Source{
  7. public static string stringX(string str){
  8. int len = str.length();
  9. if(len<3){
  10. return str;
  11. }
  12. string subStr = str.substring(1, len - 1);
  13. subStr = subStr.replace("X", "");
  14. return str.charAt(0)+subStr+str.charAt(len - 1);
  15. }
  16. public static void main(string args[]) throws exception {
  17. Scanner sc = new Scanner(system.in);
  18. string str = sc.next();
  19. system.out.println(stringX(str));
  20. }//remove first and last  characters of string
  21. }
Parsed in 0.012 seconds