This module contains various string utility routines that are uncommonly used in comparison to strutils.
Procs
proc expandTabs(s: string; tabSize: int = 8): string {...}{.noSideEffect, procvar, raises: [], tags: [].}
- Expand tab characters in s by tabSize spaces Source Edit
proc partition(s: string; sep: string; right: bool = false): (string, string, string) {...}{. noSideEffect, procvar, raises: [], tags: [].}
-
Split the string at the first or last occurrence of sep into a 3-tuple
Returns a 3 string tuple of (beforeSep, sep, afterSep) or (s, "", "") if sep is not found and right is false or ("", "", s) if sep is not found and right is true
Source Edit proc rpartition(s: string; sep: string): (string, string, string) {...}{.noSideEffect, procvar, raises: [], tags: [].}
-
Split the string at the last occurrence of sep into a 3-tuple
Returns a 3 string tuple of (beforeSep, sep, afterSep) or ("", "", s) if sep is not found
Source Edit