Questions tagged «ends-with»

30
JavaScript中的endsWith
如何在JavaScript中检查字符串是否以特定字符结尾? 示例:我有一个字符串 var str = "mystring#"; 我想知道该字符串是否以结尾#。我该如何检查? endsWith()JavaScript中有方法吗? 我有一个解决方案是获取字符串的长度并获取最后一个字符并进行检查。 这是最好的方法还是还有其他方法?


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.