endwith in python code example
Example 1: python string ends with
#!/usr/bin/python
str = "this is string example....wow!!!";
suffix = "wow!!!";
print str.endswith(suffix)
print str.endswith(suffix,20)
suffix = "is";
print str.endswith(suffix, 2, 4)
print str.endswith(suffix, 2, 6)
Example 2: endswith()
var str = "Hello world, welcome to the universe.";
var n = str.endsWith("universe.");//returns true