On Mon, Nov 15, 2021 at 7:00 PM Kamil Ziemian wrote:
> ... when in practice you should use runes?
For example the API of the unicode package uses runes extensively:
https://pkg.go.dev/unicode.
> My understanding at this moment is like that. Unicode assign every symbol a
> number (at this momen
The example given of using runes to split a string of digits into
individual digits isn't a great one, because treating the string as an
array of bytes would work just as well *in that situation*
Where it matters is when you're processing a string with codepoints > 127,
for example: "hellø wör
Thank you all for answers. I have a lot to do in next few weeks, after that
I will go back to runes and think more about your answers.
Best,
Kamil
poniedziałek, 15 listopada 2021 o 21:52:27 UTC+1 imsach...@gmail.com
napisał(a):
> On Tue, Nov 16, 2021 at 12:38 AM burak serdar wrote:
>
>>
>>
>>
On Tue, Nov 16, 2021 at 12:38 AM burak serdar wrote:
>
>
> On Mon, Nov 15, 2021 at 11:00 AM Kamil Ziemian
> wrote:
>
>> Hello,
>>
>> I read quite a few blog posts, articles, listen to nice number to talks
>> about strings, runes and encoding in Go. I now reading Go Language Spec and
>> I just st
On Mon, Nov 15, 2021 at 11:00 AM Kamil Ziemian
wrote:
> Hello,
>
> I read quite a few blog posts, articles, listen to nice number to talks
> about strings, runes and encoding in Go. I now reading Go Language Spec and
> I just stuck in the section about runes. I mean, it isn't hard as itself,
> bu
When your string contains Unicode characters dealing with it as individual
bytes is difficult. When using runes with range - each index is a “Unicode
character” (which may be multiple bytes) - which is easy to use.
See go.dev/blog/strings
> On Nov 15, 2021, at 12:00 PM, Kamil Ziemian wrote:
Hello,
I read quite a few blog posts, articles, listen to nice number to talks
about strings, runes and encoding in Go. I now reading Go Language Spec and
I just stuck in the section about runes. I mean, it isn't hard as itself,
but it raises to much questions to me. I decided that I need to le