MCPcopy Create free account
hub / github.com/antlr/codebuff / trimOneStartingNewline

Method trimOneStartingNewline

output/java/1.4.17/Misc.java:81–85  ·  view source on GitHub ↗

Strip a single newline character from the front of s.

(String s)

Source from the content-addressed store, hash-verified

79 /** Strip a single newline character from the front of {@code s}. */
80
81 public static String trimOneStartingNewline(String s) {
82 if ( s.startsWith("\r\n") ) s = s.substring(2);
83 else if ( s.startsWith("\n") ) s = s.substring(1);
84 return s;
85 }
86
87 /** Strip a single newline character from the end of {@code s}. */
88

Callers 2

defineTemplateMethod · 0.95
defineRegionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected