StrUtils

object StrUtils
class Object
trait Matchable
class Any

Type members

Types

type CharConversion = (Array[Char], Int)
type Converter = (String, Int) => Option[CharConversion]

Converter takes an index i into a string and checks how many charts it can replace If it can't replace, it returns None (no conversion) If it replaces, it returns the characters that are replaced and the next index in the string Rationale: Some conversions may require some lookahead, in which case, the index will be i + characters read

Converter takes an index i into a string and checks how many charts it can replace If it can't replace, it returns None (no conversion) If it replaces, it returns the characters that are replaced and the next index in the string Rationale: Some conversions may require some lookahead, in which case, the index will be i + characters read

Value members

Concrete methods

def cnvLoop(str: String, converters: List[Converter]): String
def escapeDot(str: String): String

escapeDot: Escapes strings to be represented as labels in Dot It follows dot conventions: https://graphviz.gitlab.io/_pages/doc/info/lang.html Extra characters are escaped using their Unicode representation

escapeDot: Escapes strings to be represented as labels in Dot It follows dot conventions: https://graphviz.gitlab.io/_pages/doc/info/lang.html Extra characters are escaped using their Unicode representation

def escapePattern(str: String): String
def escapeStringLiteral(str: String): String

Escape a string Example: "Hi\n\t" -> "Hi\n\t"

Escape a string Example: "Hi\n\t" -> "Hi\n\t"

def unescapeCode(str: String): String
def unescapeIRI(str: String): String
def unescapePattern(str: String): String
def unescapeStringLiteral(str: String): String

Unescape unicode numbers Given a string like: "p\u0031", return "p1" The code implements the Turtle rules: https://www.w3.org/TR/turtle/#sec-escapes

Unescape unicode numbers Given a string like: "p\u0031", return "p1" The code implements the Turtle rules: https://www.w3.org/TR/turtle/#sec-escapes

Value Params
str

input string

Returns

unscaped output string