#include <xtend/string.h>
-lxtend
void strtr(char *string, const char *from, const char *to, int flags)
string The string to be transformed
from Characters to be replaced with those in to
to Characters to replace those in from
flags Bit mask to enable optional features simlar to tr(1)
Translate characters in a string similar to tr(1), where each occurrence of
from[i] is replaced with to[i] in string.
Currently only replacement is supported and flags is ignored. In
the future, additional features such as deletion and compaction may be
supported.
char string[] = "Hello";
// Convert string to "HELLO"
strtr(string, "elo", "ELO", 0);