1、 String manipulation :

 String length :
s = ""; slen = len(s); String interception :
print s[:-:-] # Intercept , Reverse Division 1 One character for each print s[:-:-] # Intercept , Reverse Division 1 One character for each print s[:-:] # Intercept 0- Last but not least 17 position , Partition 1 One character for each print s[:-:-] # Intercept the penultimate 17 position -, Reverse Division 4 One character for each print s[:-:] # Intercept 0- Last but not least 17 position , Partition 4 One character for each print s[::] # Intercept , from 0-, Partition 4 One character for each
The string is divided into List
sList = list(s);## [0,1,2,3,4,5,6]

Python String manipulation , Intercept , More about the length of the article

  1. turn Python String manipulation (string Replace 、 Delete 、 Intercept 、 Copy 、 Connect 、 Compare 、 lookup 、 contain 、 toggle case 、 Segmentation, etc )

    from : http://www.cnblogs.com/huangcong/archive/2011/08/29/2158268.html Huang Cong :Python String manipulation (string Replace . Delete . Intercept . ...

  2. Python String manipulation

    Python String manipulation (string Replace . Delete . Intercept . Copy . Connect . Compare . lookup . contain . toggle case . Segmentation, etc ) Remove spaces and special symbols s.strip() .lstrip() .rstrip(',') Copy characters ...

  3. python A large collection of string manipulation real methods

    python A large collection of string manipulation real methods , It includes almost all the commonly used python String manipulation , Such as string replacement . Delete . Intercept . Copy . Connect . Compare . lookup . Segmentation, etc , Friends in need can refer to :   #1. Remove spaces and special symbols s.st ...

  4. linux shell String manipulation ( length , lookup , Replace ) Detailed explanation

    linux shell String manipulation ( length , lookup , Replace ) Detailed explanation Doing it shell When is the batch program , String related operations are often involved . There are many command statements , Such as :awk,sed Can do a variety of string operations . Actually shell Built in a series of ...

  5. shell Script —— String manipulation ( length , lookup , Replace )

    expression meaning ${var} Variable var Value , And $var identical ${var-DEFAULT} If var Not declared , Then we should $DEFAULT As its value * ${var:-DEFAULT} If var No, ...

  6. ( Regular expressions )linux shell String manipulation ( length , lookup , Replace , matching ) Detailed explanation

    Doing it shell When is the batch program , String related operations are often involved . There are many command statements , Such as :awk,sed Can do a variety of string operations . Actually shell Built in a series of operation symbols , Similar results can be achieved , As we all know , The use of internal operators is omitted ...

  7. linux shell String manipulation ( length , lookup , Replace )

    Thanks for the original , The article is very helpful . from :http://www.cnblogs.com/chengmo/archive/2010/10/02/1841355.html One . Judge to read string value expression meaning ${v ...

  8. python String operations in -- Intercept , lookup , Replace

    python in , Manipulation of strings is the most common ,python It has its own special way of handling string operations . String truncation python The index of string in is special , Let's feel it : s = '123456789' # Intercept ...

  9. ABAP String manipulation Intercept the length of the character Number of digits

    ABAP String manipulation   ABAP The operation of strings is quite different from that of other languages , The following is a more common method of string operation : 1. The connection of strings :CONCATENATEDATA: t1 TYPE c LENGTH 10 ...

Random recommendation

  1. MEF I don't want to know much about it , But try to be simple and clear ( Two )

    In the last article , We've learned very basic MEF Concept and usage . But what we export is a object Instance of type , Can be used to tostring, There is no reference to the part class library , You can't use the member method in it . This article , We're moving towards simple documents ...

  2. Natural language 22_Wordnet with NLTK

    QQ:231469242 Welcome to enjoy nltk Communicate with friends https://www.pythonprogramming.net/wordnet-nltk-tutorial/?completed=/nltk-c ...

  3. solve windows 10 Shut down the problem of automatic restart

    since windows 10 It didn't take long to push it out , I installed it on my desktop . But , What's a little tragic is : Every time I shut down , It will restart automatically (restart). After that, I found some solutions on the Internet , But it doesn't work . By searching the day before yesterday ”Windows 10 c ...

  4. Python Front end JQuery

    lookup : Selectors Filter operation : CSS attribute Text event : Optimize Expand : Form Form validation Ajax: Secretly send a request www.php100.com/manual/jquery http://blog.j ...

  5. CCF Image rotation

    201503-1 Problem description Rotation is the basic operation of image processing , In this case , You need to rotate an image counterclockwise 90 degree . Image representation in a computer can be represented by a matrix , To rotate an image , Just rotate the corresponding matrix . Input format ...

  6. hdu 1233 Or the smooth flow project ( Minimum spanning tree , Basics )

    subject // It's also the standard minimum spanning tree , I'll just change it a little bit , Don't try it again to increase your proficiency #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #inclu ...

  7. sizeof() and strlen() The difference in the length of a string

    sizeof() The function takes the terminator into account when it outputs the length of the string : strlen() The terminator is not counted in the output string length of the function . Pictured :

  8. From the compilation c++ Evaluation of inline functions

    stay c++ in , One inline Function entity , Throughout class Before the statement is fully seen , It will not be evaluated , in other words , For the analysis of the member function itself in the class , Wait until the class It's not until the end of the statement . Next interview c++ Source ...

  9. VMware vSphere Client Develop physical network cards for virtual machines ( illustrated )

    1. First , Check how many network cards my server has , The following is a total of 3 Zhang , Next, I will make a network card for the virtual host , And for the two virtual CentOS7 Each has a network card . 2. open “ Hardware ”---->“ The Internet ”, Pictured , A net has been activated ...

  10. git reset reveal

    One . command First , Let's explain a few definitions .   HEAD( head )      Point to the present branch The top one commit, The branch last commit After the node   Index( Indexes )     The index, ...