I
I
impressive172019-12-08 18:05:01
go
impressive17, 2019-12-08 18:05:01

How to work with char in GO?

Can you please tell me how to work with symbols in GO? I know that there is byte and rune, but there is no such analogue of char. If I want to create let's say slice ['a', 'b', 'c'] and output all elements to the screen. How can I do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-12-08
@impressive17

It is possible more in detail why you need to work with rune/char? Rune is int32, the code for a Unicode character
Variants, on the question asked, that came to my mind: https://play.golang.org/p/9QoG8RCNtGO
Useful article on strings https://blog.golang.org/strings

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question