JLStringUtilities¶
jutils.spad line 122 [edit on github]
This package provides JL
facilities that operate on strings.
- jlLatex: String -> String
jlLatex(str)
returns the String corresponding to aJL
LaTeX expression, that is, “L”str”” if yourJL
support it (LaTeXStrings package). Convenience function.
- jlMessageStyled: (String, JLSymbol) -> Void
jlMessageStyled(message, color)
print themessage
with formatted color (english color). For example jlMessageStyled(“I AM HERE!!!”, “red”)
- jlMessageStyled: String -> Void
jlMessageStyled(message)
print themessage
with formatted style within braces (I
am {red:here}). For example: jlMessageStyled(“{red:■} {green:■} {yellow:■} {blue:■} {magenta:■} {cyan:■}”)
- jlRegex: String -> String
jlRegex(str)
returns the String corresponding to aJL
regular expression, that is, “r_”str_””. Convenience function.
- jlRegexMatch?: (String, String) -> Boolean
jlRegexMatch?(s, regex)
checks if the regular expression matches ins
.
- jlRegexMatch: (String, String) -> AssociationList(String, String)
jlRegexMatch(s, regex)
returns the matched regular expressions ins
.
- jlRegexMatch: (String, String) -> List String
jlRegexMatch(s, regex)
returns the matched regular expressions ins
.
- jlRegexMatch: (String, String) -> String
jlRegexMatch(s, regex)
returns the matched regular expression ins
.
- jlRegexMatch: (String, String, PositiveInteger) -> AssociationList(String, String)
jlRegexMatch(s, regex, i)
returns the matched regular expressions ins
, starting at indexi
.
- jlRegexMatch: (String, String, PositiveInteger) -> List String
jlRegexMatch(s, regex, i)
returns the matched regular expressions ins
, starting at indexi
.
- jlRegexMatch: (String, String, PositiveInteger) -> String
jlRegexMatch(s, regex, i)
returns the matched regular expression ins
, starting at indexi
.
- jlRegexReplace: (String, String, String) -> String
jlRegexReplace(str, regex, subst)
will replace captured regular expressions instr
with subst. More information in String documentation ofJL
. For example: jlRegexReplace(“hey”, jlRegex(”$”), jlSubstitute(” you!”))
- jlSplit: (String, String) -> List String
jlSplit(str, delims)
splitstr
with delimiter(s
) delims (a string or a regular expression). Equivalent to jlSplit(str
, delims, 0).
- jlSplit: (String, String, NonNegativeInteger) -> List String
jlSplit(str, delims, n)
splitstr
with delimiter(s
)delims
(a string or a regular expression). Return a list of sizen
. Parse entirelystr
ifn
= 0.