Sunday, January 4, 2015

Trim strings

- To remove final nulls from strings coming from a buffer:
 strings.TrimRight(myStringFromABuffer, "\x00")

- To remove new lines from string:
 strings.Trim(myString, "\r\n")

No comments:

Post a Comment