substr() / find()
Substring extraction and searching.
Syntax
text.substr(start, length)
Description
substr returns a piece; find gives the position (or string::npos if not found).
Example
Loading editor…
Expected output
Hex 1
When to use?
First N characters, searching.