I need to know whether check whether a String end with something like .xyz plus any characters after it.
Like this:
myString.endsWidth(".css*")
However this does not pass my if-statement. One concrete example is this kind of string: style.css?v=a1b23
Any ideas?
Complete example String:
http://xyz.com//static/css/style.css?v=e9b34
hum, I am guessing something like this is even better:
return myString.indexOf(".css")>-1;
If you really want to go with regexp, you could use this
return myString.matches(".*?\\.css.*");
endsWith
takes a string as parameter
matches
takes a regular expression
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With