[英]Replace Last Character of String
I want to replace the last character in a string with a word. 我想用一个单词替换字符串中的最后一个字符。
Eg, 'Flight 12345 A' and I want it to look like 'Flight 12345 Auckland' The last character can also be W, C, D, Q which stand for different city names. 例如,“航班12345 A”,我希望它看起来像“航班12345奥克兰”。最后一个字符也可以是W,C,D,Q,代表不同的城市名称。
How can I go about achieving this with js / jQuery?? 如何使用js / jQuery实现此目标?
Thanks heaps in advance! 预先感谢堆积!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.