Advertisement
kimo12

Untitled

May 6th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.40 KB | None | 0 0
  1.     private String checkFormat(String line) {
  2.         if (line.charAt(0) == '\t') {
  3.             line = line.replaceFirst("\t", "    ");
  4.         }
  5.         if (line.length() > 1 && line.charAt(1) == '\t') {
  6.             line = line.replaceFirst("\t", "   ");
  7.         }
  8.         if (line.length() > 2 && line.charAt(2) == '\t') {
  9.             line = line.replaceFirst("\t", "  ");
  10.         }
  11.         if (line.length() > 4 && line.charAt(4) == '\t') {
  12.             line = line.replaceFirst("\t", "    ");
  13.         }
  14.         if (line.length() > 5 && line.charAt(5) == '\t') {
  15.             line = line.replaceFirst("\t", "   ");
  16.         }
  17.         if (line.length() > 6 && line.charAt(6) == '\t') {
  18.             line = line.replaceFirst("\t", "  ");
  19.         }
  20.         if (line.length() > 10 && line.charAt(10) == '\t') {
  21.             line = line.replaceFirst("\t", "  ");
  22.         }
  23.         if (line.length() > 12 && line.charAt(12) == '\t') {
  24.             line = line.replaceFirst("\t", "    ");
  25.         }
  26.         if (line.length() > 13 && line.charAt(13) == '\t') {
  27.             line = line.replaceFirst("\t", "   ");
  28.         }
  29.         if (line.length() > 14 && line.charAt(14) == '\t') {
  30.             line = line.replaceFirst("\t", "  ");
  31.         }
  32.         if (line.length() > 8 && line.charAt(8) != ' ') {
  33.             System.out.println("Error in Format");
  34.         }
  35.         if (line.length() > 15 && line.charAt(15) != ' ' && line.charAt(15) != '\t') {
  36.             System.out.println("Error in Format");
  37.         }
  38.         if (line.length() > 16 && line.charAt(16) != ' ' && line.charAt(16) != '\t') {
  39.             System.out.println("Error in Format");
  40.         }
  41.         return line;
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement