I have an element that looks like this:
<span class="tab_caption_text">Change Tasks (1)</span>
Of course, the rendered button says "Change Tasks (1)" not "Change Tasks (1)"
my problem is that
driver.findElement(By.xpath("//span[contains(text(), 'Change Tasks')]");
does not work because the space is considered an  . Now I can't use   because they will be passing in the tab to search for. there are many with two words. The caller would have to use instead of space.
Is there any way I can search for this? I suppose the caller of my method could pass something like "Change Tasks" and I could do a replaceAll(" ", " ") but that seems awfully clumsy doesn't it?
p.s., this is with Chromedriver, java 1.8 and selenium