J'ai une chaîneComment implémenter un "EndsWith" sur une chaîne?
var s1 = "a,$,b,c";
Je veux vérifier si une autre chaîne se termine par s1
Donc, si je vous envoie ces chaînes, il doit retourner true
w,w,a,$,b,c
^,^,^,$,@,#,%,$,$,a,$,b,c
a,w,e,q,r,f,z,x,c,v,z,$,W,a,$,b,c
Et pour ces false
a,$,b,c,F,W
a,$,b,c,W
a,$,b,c,$,^,\,/
Comment puis-je vérifier?
Voir http: // stackoverflow .com/questions/280634/endswith-in-javascript –