Summarize the operation of string in C + + from 〈c++ primer〉 version fourth.1. Definition and initialization of a string object:
12345678910111213
string S1; Empty stringString S2 (
Capitalize (): Capitalize the 1th character in a stringCenter (width): Returns a string with a length of at least width and centers the contents of the original stringCount (Str,beg=0,end=len (String)): Returns the number of occurrences of STR
The sequence contains a treasure table (tuple) and a table (list). In addition, a string is a special table of values, and the elements of the table can be changed, and once established, the elements cannot be changed. Any sequence can refer to its
Python's string commonly built-in functions are as follows:
Serial Number
Method and Description
1
Capitalize ()Converts the first character of a string to uppercase
2
Center (width,
Methods and comments for strings
Capitalize ()
Change the first character of a string to uppercase
Casefold ()
Change all characters of the entire string to lowercase
Center (width)
Centers
Why do scripts use the./+ script name to execute the scriptUnderstand:Because if the script name is used directly, then the Linux system will go to path path to findsuch as go to/bin usr/bin, such as find, this time will not find the script name,
Read Catalogue
Numerical test
File test
String test
The test command in the shell is used to check if a condition is true, and it can be tested in three ways, such as numeric values, files, and characters.
First, the basics of learning Shell scripts" Special symbols in theLinux shell "1. * : Represents 0 or more characters or numbers.Test can have no characters, or multiple characters, or it can be matched.2.? : represents only one arbitrary
Shell Programming for Linux1. What is a shell?When a user logs on to a Linux system, the system initialization program Init runs a program called a shell (shell) for each user.The shell is a command-line interpreter that provides the user with an
Tag: value is update copy variable content how much ISA stateObjective1.Python uses the object model to store data, each data type has a built-in class, and each new data is actually an object, that is, all data is objects.2.3 Properties of the
Value by indexStrings are immutable types and cannot change the value of a stringThere can be up to three parameters, the starting position, the end and the stride length, can be positive value, the response value (the starting position is greater
Linux Shell if parameterUsed in shell programming to determine parameters within an if statement–b return True when file exists and is a block file-C Returns True when file exists and is a character-D returns True when pathname exists and is a
Capitalize ()
Change the first character of a string to uppercase
Casefold ()
Change all characters of the entire string to lowercase
Center (width)
Centers the string and fills the new string with a space
I. DigitalPython supports three different numeric types:
Integral type (INT): No size limit for integers. (python3.x), also available in 16 binary or octal notation.
Float type (float): can also be represented by scientific notation (2.5
1Capitalize ()Converts the first character of a string to uppercase2Center (width, Fillchar)Returns a string that specifies the width of the center, Fillchar is a filled character, and the default is a space.3Count (str, beg= 0,end=len
Capitalize ()
Change the first character of a string to uppercase
Casefold ()
Change all characters of the entire string to lowercase
Center (width)
Centers the string and fills the new string with a space
It's a bit of a hassle to compare the members of two objects in JavaScript, but if it's just the first level comparison, it's easy, but the attributes in the child object may be an object, so you can only recursively
The code is as
File expression-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if
The test command is commonly used to check whether certain conditions are true.Numerical test-EQ: Detects whether two numbers are equal, equal returns True-ne: Detects whether two numbers are equal, not equal returns True-GT: Detects if the left
File expression-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if
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.