Data type 1.int: numeric type. Mainly used to calculateInt:bit_length () converted to a valid number of digits in binaryi = 3i1 = int.bit_length (i) print (I1)int--->str ' int '--->str (int)2.STR: String type. Storing a small amount of data for
String Common operations
JudgeVariable. EndsWith ("trailing character"): determines the ending string.Variable. Isalnum (): Determines whether it is a letter or a number.Variable. Isalpha (): Determines whether it is an English
Each language has his own string manipulation method, the shell is the same, the following in an example of the way, a simple introduction of common methods.
1, get string length
Copy Code code as follows:
[Zz]linux string manipulation functionPublished 1 years ago (1) strcat (connecting two strings)
Related functions
bcopy,memccpy,memcpy,strcpy,strncpy
Header file
#include
function definition
Char *strcat (char *dest,const char *src);
Function
--The length of the stringSELECT Length (' abc '), Length (' My home ');SELECT char_length (' abc '), Char_length (' my Home ');--Merging stringsSELECT CONCAT (' A ', ' B ', ' C '), Concat_ws (', ', ' A ', ' B ', ' C '), CONCAT (null, ' a '), Concat_
--Aliases and expressionsSelect Orderdate,year (OrderDate) as order yearFrom orders;--SelectSelect Orderdate,year (OrderDate) as order yearFrom OrdersWhere year (OrderDate) = 2006;--in the case of grouping, the select sentence will have a limit, can
Character function--return character valueThese functions all receive parameters of the character family type (except CHR) and return the character value. In addition to the special instructions, most of these functions return a numeric value of
http://blog.csdn.net/shuanghujushi/article/details/51298672During the bash Shell's use, there are a number of string manipulations that are often encountered, and some of the individual usage summaries are summarized below.First, the definition of a
1. String length:Var=123abc456echo ${#var}9expr length $var 92. Specify character interceptionEcho ${var:5} #截取前五个字符c456echo ${var:2:5} #截取第2到第5个字符3abc4echo ${var: 3} 3 characters after intercept (with space on the left) 4563. Interception of
Welcome to visit the blog Create string Create string Object-1
public class Test {public
static void Main (string[] args) {
string s = new string ();//create String
System.out.print ln (s);
}
}
Create a String Object-2
public
C # Performance Tuning details
1. Use String. Empty to assign an initial value to a null string variable
String.Empty is a reference, and "" is the concrete realizationString Filter= "";//String filter=string not recommended. Empty;
1, go to the space and special symbols
S.strip () S.lstrip () S.rstrip () S.strip (). Lstrip (). Rstrip ()
declaration : S is a string, RM is a sequence of characters to be deleted
S.strip (RM) Remove the characters from the beginning and end of
Python intercepts the string using the variable [header subscript: tail subscript], you can intercept the corresponding string, where the subscript is starting from 0, can be positive or negative, subscript can be empty to take the head or
1. String connector
Half-width symbol "." is a string connector that can concatenate two or more than two strings into a single string. For example:
The result of the operation is: topic.alibabacloud.com:www.php.cn
2. Remove string leading and
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.