Julia Int String Value

I am new to Julia and struggling to find the integer value of a string.

I know that calling int ('a') will return the value I'm looking for, but I cannot figure out how to do the same for int ("a").

Is there a way to convert a string value to a character?

UPDATE: Yes, the solution you provided works, but not in my case. I probably should have been more specific. This is what my array of strings looks like

array = ["12", "13", "14"] ["16", "A"]

array [2] [2] returns "A" not "A"

+4
source share
2 answers

" " Julia:

julia> str = "Hello, world.\n"
"Hello, world.\n"

, :

julia> str[1]
'H'

julia> str[6]
','

julia> str[end]
'\n'

, 1, int.

+2

Uint8, ASCIIString :

julia> "Hello".data
5-element Array{Uint8,1}:
 0x48
 0x65
 0x6c
 0x6c
 0x6f

Unicode, .

+4

Source: https://habr.com/ru/post/1529691/


All Articles