This article describes how to use the rstrip () method to operate strings in Python. it is a basic knowledge in Python. For more information, see rstrip () returns a copy of the ending string of all characters removed from the string (space
Use the rstrip () method to operate strings in Python, pythonrstrip
The rstrip () method returns a copy of the ending string of all characters removed from the string (space character by default.Syntax
The syntax of the rstrip () method is as
This article mainly introduces the strip, lstrip, and rstrip functions in python. For more information, see
I. cause
In role control today, rstrip is used to determine whether the url requested by the user matches the url in the available
Detailed usage of strip (), lstrip (), and rstrip () in Python, and lstriprstrip
Python has three functions to remove leading and trailing characters and spaces. They are:Strip: used to remove leading and trailing characters and blank spaces
First, causesToday in the role control, there is a place to use Rstrip to determine whether the URL requested by the user corresponds to the URL in the database for the available permissions.if or Request.path. Rstrip ('/'# exact match to determine
First, causes
Today in the role control, there is a place to use Rstrip to determine whether the URL requested by the user corresponds to the URL in the database for the available permissions.
if Request.path = = X.url or Request.path.rstrip ('/') =
Strip in python is used to remove the first character of a string. Similarly, lstrip is used to remove the character on the left, and rstrip is used to remove the character on the right. All three functions can be passed in a parameter, specifying
This article mainly introduces the use of the Rstrip () method of manipulating strings in Python, which is the basic knowledge of Python's introduction, and needs friends to refer to the following
The Rstrip () method returns a copy of the string
The Rstrip () method returns a copy of the ending string for all characters that are stripped (the default is a space character).
Grammar
The following is the syntax for the Rstrip () method:
Str.rstrip ([chars])
Parameters
Chars--can
I. Principles:
Strip in Python is used to remove the first and last characters of a string. Similarly, lstrip is used to remove the characters on the left, and rstrip is used to remove the characters on the right. All three functions can be passed
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.