Normalize space is used to remove the empty spaces at the ends of the string while using xpath.
normalize-space(string)
str = " cher cher tech "
normalize-space(string) // outputs "cher cher tech"
With code example
html code
<label> who cares about spaces </label>
xpath
//label[normalize-space(text())='who cares about spaces']