src/pon2/private/strutils

Source   Edit  

This module implements string utilities.

Procs

func parseInt(str: string): Pon2Result[int] {.inline, noinit, ...raises: [],
    tags: [], forbids: [].}
Returns the integer converted from the string. Source   Edit  
func parseOrdinal[T: Ordinal](str: string): Pon2Result[T] {.inline, noinit,
    ...raises: [].}
Returns the ordinal type converted from the string. Source   Edit  
func split2(str, sep: string; maxsplit = -1): seq[string] {.inline, noinit,
    ...raises: [], tags: [], forbids: [].}
Returns a sequence of substrings by splitting the string with the given separator. If the string is empty, returns an empty sequence. Source   Edit  

Iterators

iterator split2(str, sep: string; maxsplit = -1): string {.inline, ...raises: [],
    tags: [], forbids: [].}
Iterates over substrings by splitting the string with the given separator. If the string is empty, yields nothing. Source   Edit