Ben Chuanlong Du's Blog

It is never too late to learn.

Useful Rust Crates for String

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

bstr

bstr A string type that is not required to be valid UTF-8.

arcstr

arcstr is a better reference-counted string type, with zero-cost (allocation-free) support for string literals, and reference counted …

String in Golang

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips and Traps

  1. string is a primitive type in Golang, which means a string value has no methods on it but instead you have to use built-in functions (e.g., len) or functions in other modules (e.g., the strings

Format a String in Python

str.format

An exception will be thrown if the value for a key in the string is not specified, which means that you must specify values for all keys. However, it is OK if you specify values for keys that do not exist in the string. That is you can specify values for more keys than needed.