trimComment static method

String trimComment(
  1. String source
)

Implementation

static String trimComment(String source) {
  int startPos = source.lastIndexOf('\n') + 1;
  int commentStart = commentStartPos(source, startPos);
  if (commentStart >= 0) return source.substring(startPos, commentStart);
  return source;
}