devxlogo

Remove occurrences of a characters trailing within a given string

Remove occurrences of a characters trailing within a given string

Use the rstrip method to return the string with all occurrences of the trailing characters removed. 

For e.g. 
inputString = “devxyyy”
inputString.rstrip(???y???) gives ???devx???

devx-admin

Share the Post: