code: public static String replaceTabsWithSpaces(String text, int tabSize) {
          String tabText = "";
          for (int i = 0; i < tabSize; i++) {
              tabText += " ";
          }
  
          return text.replaceAll("\t", " ");
      }
docs: Replaces all instances of the tab character in <code>text</code> with
  the spaces.
  
  @param text The <code>java.lang.String</code> in which to replace tabs
  with spaces.
  @return A <code>java.lang.String</code> just like <code>text</code>,
  but with spaces instead of tabs.