Python--> base-->003-> String processing

Source: Internet
Author: User

First, remove the string white space

Note: That is, to remove the end of the string (that is, the head and tail) white space (the space itself, carriage return \ r, newline \ n, tab \ t, page break \f)

Instance:

"print str01print Str01.  Strip()  #删除了字符串的首尾的百空格print Str01.  Lstrip() "#删除左边的百空格print Str01. Rstrip ()  #删除右边的百空格 ABC def #-   -and the left and right spaces are all in the ABC def #    --both sides of the space are deleted ABC def #--    removed the left space ABC def #< C13/>--> deleted the right space

Strip is generally used to remove the unwanted, invisible characters (so-called white spaces) of a character's end and end.

http://blog.csdn.net/forevernull/article/details/22529705

Python--> base-->003-> String processing

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.