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