MCPcopy Index your code
hub / github.com/endbasic/endbasic / strip_newline

Function strip_newline

cli/src/propline.rs:31–38  ·  view source on GitHub ↗

Strips the newline terminator from `s` if present.

(s: &mut String)

Source from the content-addressed store, hash-verified

29
30/// Strips the newline terminator from `s` if present.
31fn strip_newline(s: &mut String) {
32 if s.ends_with('\n') {
33 s.pop();
34 if s.ends_with('\r') {
35 s.pop();
36 }
37 }
38}
39
40/// Parses a propline from `line`.
41///

Callers 1

extract_proplineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected