[-] glynwolf@tiggi.es 2 points 1 day ago

@vk6flab Pascal was my learning language!

[-] glynwolf@tiggi.es 1 points 1 day ago

@cows_are_underrated The simplest way I’ve found to do that is to convert the string into a Vec<char>. UTF-8 strings aren’t optimized for random access because of multi-byte chars.

To array of chars:
let c = s.chars().collect::<Vec<char>>();

And back to string:
let s = c.into_iter().collect::<String>();

glynwolf

joined 3 years ago