Clear sequence numbers in column 1-6 and anything beyond column 72.

@param line the line of code
@return a line of code without sequence numbers
502
public String cleanFixedLine(final String line) {

        StringBuilder cleanedLine = new StringBuilder();
        int length = line.length();

        /* Clear sequence numbering */
        for (int i = 0; i < _startColumn - 1; i++) {
            cleanedLine.append(" ");
        }

        /* Trim anything beyond end column */
        if (length > _startColumn - 1) {
            String areaA = line.substring(_startColumn - 1,
                    (length > _endColumn) ? _endColumn : length);

            cleanedLine.append(areaA);
        }
        return cleanedLine.toString();
    }
1314292
private void removeLinesFromXml(Rule rule, String sentenceToRemove, List<String> xmlLines) {
    List<Integer> linesToRemove = new ArrayList<>();
    String currentRuleId = null;
    Pattern pattern = Pattern.compile(".*id=[\"'](.*?)[\"'].*");
    String expectedSubId = ((AbstractPatternRule) rule).getSubId();
    int lineCount = 0;
    int subRuleCount = 0;
    int removedCount = 0;
    boolean inRuleGroup = false;
    for (String xmlLine : xmlLines) {
      if (xmlLine.contains("<rulegroup")) {
        subRuleCount = 0;
        inRuleGroup = true;
      } else if (xmlLine.contains("</rulegroup>")) {
        subRuleCount = 0;
        inRuleGroup = false;
      } else if ((xmlLine.contains("<rule ")||xmlLine.contains("<rule>")) && inRuleGroup) {
        subRuleCount++;
      }
      Matcher m = pattern.matcher(xmlLine);
      if (m.matches()) {
        currentRuleId = m.group(1);
      }
      if (!xmlLine.contains("correction=") && xmlLine.contains(sentenceToRemove + "</example>")) {
        if (currentRuleId != null && !currentRuleId.equals(rule.getId())) {
          lineCount++;
          continue;
        }
        if (!inRuleGroup) {
          subRuleCount = 1;
        }
        if (!expectedSubId.equals("0") && !expectedSubId.equals(String.valueOf(subRuleCount))) {
          lineCount++;
          continue;
        }
        linesToRemove.add(lineCount);
        break;
      }
      lineCount++;
    }
    Collections.reverse(linesToRemove); // start from end, as we need to remove items
    for (Integer s : linesToRemove) {
      xmlLines.remove(s.intValue());
      removedLinesCount++;
      removedCount++;
    }
    if (removedCount == 0) {
      System.err.println("No line removed: " + rule + "[" + expectedSubId + "]");
    }
  }
393111
private int findIndex(String line) {

        int index = -1;

        if (line == null) {
            return index;
        }

        String trimmedLine = line.trim();
        int spaceIndex = trimmedLine.indexOf(" ");
        int tabIndex = trimmedLine.indexOf("\t");

        if (spaceIndex != -1) {
            if (tabIndex != -1) {
                if (spaceIndex < tabIndex) {
                    index = spaceIndex;
                } else {
                    index = tabIndex;
                }
            } else {
                index = spaceIndex;
            }
        } else {
            index = tabIndex;
        }
        return index;
    }
1295196
private String cutAfterTab(String line) {
        Pattern p = Pattern.compile("^(.*)\\t.*$");
        Matcher matcher = p.matcher(line);
        if (matcher.matches()) {
            return matcher.group(1);
        } else {
            return line;
        }
    }
428553
public static void clearOutput(int newlines) {
        char[] chars = new char[newlines];
        Arrays.fill(chars, '\n');
        System.out.println(chars);
    }
484450
def remove_line(self, section, line):
        
        try:
            s = self._get_section(section, create=False)
        except KeyError:
            # No such section, skip.
            return 0

        return s.remove(line)
279276
def clean(self, line):
        
        # print ("-" + line + "-")
        if line == '':
            line = 'None'
        if self.is_lower:
            line = line.lower()
        if line == "user ":  # for slurm which has "user" and "user "
            line = "userid"
        for convert in self.change:
            line = line.replace(convert[0], convert[1])
        if self.is_strip:
            line = line.strip()
        return line.strip(' ')
961507
public List<String> replaceAbstractClasses(List<String> lines) {
        List<String> result = new LinkedList<String>();
        for (int i = 0; i < lines.size(); i++) {
            result.add(removeAbstract(lines.get(i)));
        }
        return result;
    }
723721
public static String uncommentLine( String line ) {

		String result = line;
		if( ! Utils.isEmptyOrWhitespaces( line )
				&& line.trim().startsWith( ParsingConstants.COMMENT_DELIMITER ))
			result = line.replaceFirst( "^(\\s*)" + ParsingConstants.COMMENT_DELIMITER + "+", "$1" );

		return result;
	}
701962
def clear_line(self, lines=None, bitmask=None,
                   leave_remaining_lines=False):
        
        if lines is None and bitmask is None:
            raise ValueError('Must set one of lines or bitmask')
        if lines is not None and bitmask is not None:
            raise ValueError('Can only set one of lines or bitmask')

        if bitmask is not None:
            if bitmask not in range(0, 256):
                raise ValueError('bitmask must be an integer between '
                                 '0 and 255')

        if lines is not None:
            if not isinstance(lines, list):
                lines = [lines]

            bitmask = 0
            for l in lines:
                if l < 1 or l > 8:
                    raise ValueError('Line numbers must be between 1 and 8 '
                                     '(inclusive)')
                bitmask |= self._lines[l]

        self.con.clear_digital_output_lines(bitmask, leave_remaining_lines)
1269919
private int getLineBreakColumnIndex(int lineIndex) {
    int lineBreakIndex = lineBreakIndices.get(lineIndex);
    return (lineIndex == 0) ?
         lineBreakIndex : lineBreakIndex - lineBreakIndices.get(lineIndex - 1) - 1;
  }
831408
public final long clear(long numberToClear)
    {
        long numberRemainingToClear = numberToClear;
        // Avoid locking the Map by looking at the subMaps indivdually starting at a
        // random point in the sequence, so as not to disturb the distribution.
        int index = new java.util.Random(Thread.currentThread().hashCode()).nextInt(subMaps.length);
        int numberEmpty = 0;
        while (numberRemainingToClear > 0 && numberEmpty < subMaps.length) {
            java.util.Map subMap = subMaps[index];
            synchronized (subMap) {
                if (!subMap.isEmpty()) {
                    java.util.Iterator iterator = subMap.entrySet().iterator();
                    iterator.next();
                    iterator.remove();
                    numberRemainingToClear--;
                    numberEmpty = 0;
                } else {
                    numberEmpty++;
                } // if (subMap.isEmpty()).
            } // synchronized (subMap).

            index++;
            if (index == subMaps.length)
                index = 0;
        } // while (numberRemainingToClear > 0).

        return numberToClear - numberRemainingToClear;
    }
174990
private void skipToEndOfLine() throws IOException {
    while (pos < limit || fillBuffer(1)) {
      char c = buffer[pos++];
      if (c == '\n') {
        lineNumber++;
        lineStart = pos;
        break;
      } else if (c == '\r') {
        break;
      }
    }
  }
78695
private static String getClassFromLine(String line) {
        line = line.trim();

        // Skip commented lines
        if (line.length() == 0 || line.startsWith("#"))
            return null;

        // lop off spaces/tabs/end-of-line-comments
        String[] className = line.split("[\\s#]");

        if (className.length >= 1)
            return className[0];

        return null;
    }
22034
private int numOfTabs(String line) {
        int i = 0;
        while (i < line.length() && '\t' == line.charAt(i)) {
            i++;
        }
        return i;
    }
498743
public static String[] disectCommandLine(String line) {
		return StringSupport.split(line, "() ,;", "\"", false, false, false).toArray(new String[0]);
	}
344693
protected static String parseValue (String line)
    {
        int eidx = line.indexOf("=");
        return (eidx == -1) ? "" : line.substring(eidx+1).trim();
    }