bash strip preceeding white space

C++
# Basic syntax:
sed 's/^ *//g'

# Example usage:
echo '                    text' # Printing without sed command
-->                     text
echo '                    text' | sed 's/^ *//g' # Pipe to sed command
--> text
Source

Also in C++: