tr replace char for

C++
#Use sed for replacing a char witha string as in following example:
echo "a~b" | sed 's/~/==/g'
Source

Also in C++: