ends-with function is defined in the W3C XPath 2.0 specification, but no browser support it. You can not use ends-with in Selenium tests.
But you can write an equivalent XPath expression using substring and string-length function of XPath1.0. Both functins are supported by any browser. See the following post for example: