3 ms·
Another difference is that &str is guaranteed to be utf-8, whereas const char* can be any encoding (or no encoding).
by School-Cotton 1y ago
Another difference is that &str is guaranteed to be utf-8, whereas const char* can be any encoding (or no encoding).
- pdpi 1y agoAlso, &str is closer to const uint8_t* than it is to const char*. Chars are signed by default and are at least 8 bits, but can be wider.