MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / was_nl

Method was_nl

chapter24/src/main/java/com/seaofnodes/simple/util/SB.java:72–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 public SB nl( ) { return p(System.lineSeparator()); }
71 // Last printed a nl
72 public boolean was_nl() {
73 int len = _sb.length();
74 String nl = System.lineSeparator();
75 int nlen = nl.length();
76 if( len < nlen ) return false;
77 for( int i=0; i<nlen; i++ )
78 if( _sb.charAt(len-nlen+i)!=nl.charAt(i) )
79 return false;
80 return true;
81 }
82
83 // Delete last char. Useful when doing string-joins and JSON printing and an
84 // extra separater char needs to be removed:

Callers

nothing calls this directly

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected