在julia 0.6中有可能通过其名称获得unicode字符吗?
在python中,它可以做到
s = u'\N{SECTION SIGN}'
Run Code Online (Sandbox Code Playgroud)
有什么相似之处?我知道我能做到
s = '\u00a3'
Run Code Online (Sandbox Code Playgroud)
但我想通过名字来做.
谢谢
通过 s = f"\N{SECTION SIGN}"
StringLiterals.jl刚刚注册了.你可以通过安装它Pkg.add("StringLiterals")
julia> using StringLiterals
julia> s = f"\N{SECTION SIGN}" #Unicode Entity
"§"
julia> f"\N{SNOWMAN}" #Unicode Entity
"?"
julia> f"\:mage:" #Emoji Entity
"\U1f9d9"
julia> f"\<sun>" #LaTeX Entity
"?"
julia> f"\€" # HTML Entity
"€"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
97 次 |
| 最近记录: |