MySQL has a TRIM()
function that enables you to remove leading and/or trailing whitespace from a string.
You can also use it to remove other specified characters from either side (or both sides) of the string.
This article explains how to remove specified leading/trailing characters from the string.