Le jeudi 04 février 2016 à 17:31 -0800, julialangfans...@gmail.com a
écrit :
> in python, "abc def ghi jkl".title() capitalizes each "word" in the
> string, giving 'Abc Def Ghi Jkl' as the result
> 
> i have not been able to find a similar string function in julia, so
> i'm currently doing this:
> 
> julia> join(map(ucfirst, split("abc def ghi jkl")), " ")
> "Abc Def Ghi Jkl"
> 
> is there a better / more straightforward julia-based solution?
I wouldn't call it "straightforward", but if you need a Unicode-correct 
way of applying title case, you can use UnicodeExtras, which relies on
ICU:
https://github.com/nolta/UnicodeExtras.jl#case-handling

Title case hasn't been implemented in base yet, though it's been
mentioned in the past:
https://github.com/JuliaLang/julia/issues/11471
https://github.com/JuliaLang/julia/issues/774


Regards

Reply via email to