Strs.jl is a container for a number of different packages from JuliaString
It has two main goals:
To be a drop-in replacement for the built-in String and Char types, adding types that are both faster and easier to use,
that are also using for interfacing with other languages, and are safer to use.
To have a better option than the built-in string literal syntax and the @printf/@sprintf macros for formatted output.
This uses Swift-style \ escape sequences, such as \u{xxxx} for Unicode constants, instead of \uXXXX and \UXXXXXXXX, which have the advantage of not having to worry about some digit or letter A-F or a-f occurring after the last hex digit of the Unicode constant.
It also means that $, a very common character for LaTeX strings or output of currencies, does not need to be in a string quoted as '$'
It uses \(expr) for interpolation like Swift, instead of $name or $(expr), which also has the advantage of not having to worry about the next character in the string someday being allowed in a name.
It allows for embedding Unicode characters using a variety of easy to remember names, instead of hex codes:
\:emojiname:\<latexname>\N{unicodename}\&htmlname;
Examples of this are:
f"\<dagger> \¥ \N{ACCOUNT OF} \:snake:", which returns the string: "† ¥ ℀
请发表评论