The Maya .endswith() command in Python

Determine if a string ends with something specific:

object.endswith(target)

Let’s see an example:

# Set the value of 'suffix' to the string 'new'
suffix = "new"

# Set the value of 'objectText' to the string 'I_am_new'
objectText = "I_am_new"

# Check if the object ends with 'new'
if objectText.endswith(suffix):
  print "Object text is suffixed new"