Strip a single newline character from the front of s.
(String s)
| 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 |
no outgoing calls
no test coverage detected