Json.parse () and json.stringifyParse is used to parse a JSON object from a string, such asvar str = ' {' name ': ' Huangxiaojian ', ' age ': ' 23 '} 'Results:Json.parse (str)Object
Age: "All"
Name: "Huangxiaojian"
__proto__:
First, the local substitution of the stringPython string substitution can be implemented in 2 ways:1 is the method of using the string itself.2 replacing a string with a regularHere's an example to experiment with:A = ' Hello word 'I replaced word
1. Find the character position function:strpos($str,search,[int])://查找search在$str中的第一次位置从int开始;strrpos($str,search,[int])://查找search在$str中的最后一次出现的位置从int开始2. Extracting sub-character functions (double-byte)submit($str,int start[,int
Here is a list of some of the operation of the string, convenient for later use when the query.1.capitalizePrint ("My name is Galen". Capitalize ()) #首字母大写My name is Galen2.centerPrint ("My name is Galen". Center (30, "-")) #字符串居中显示30个字节, the other
name = "My name is Warren, \tsex is {XXX}, and age was {age}."Print (Name.capitalize ()) #这段话的首字母大写Print (Name.count ("a")) #统计这段字符串中一共有多少个aPrint (Name.casefold ())Print (Name.center, "-") #一共打印50个字符, put the original string in the middle, both
CharAt (n)//returns the character of the specified position (n) var str= "ABCDEFGE";Console.log (Str.charat (3)); Output dIndexOf (s,n)//Returns the position of the s first word backward from the position of n var str= "ABCDEFGE";Console.log
Package Day01;import Org.junit.test;public class TestString {/** * Test constant POOL * * */@Testpublic void Testconstantpool () {String str1 = "Hello";//string str2 = "Hello";//two objects are compared using = =, and a return value of TRUE
PowerShell Basic outline of the script
constants, use of variables
Operations on various strings
Operations on operators
arrays, hash tables: creating, modifying merged arrays and hash tables
Conditional
One: Linux shell string interception and splicingSuppose there is a variable var=http://www.linuxidc.com/123.htm 1 # Intercept, delete the left character, and leave the right character. Echo ${var#*//}where Var is the variable name and the # is an
S.strip (chars) s.find (x,start,end) s.index (x.start,end)#see above;S.format ()#see above;S.partition (x)#see above;S.replace (X,y,n)#replace x with Y, optional n means maximum substitution n times;S.split (X,n)#divide up to n times, S.rsplit ()
Manipulation of stringsThe Capitaliza () Str.capitaliza () method returns a string with the first letter capitalized and the other lowercase lettersCount () Str.count (Sub,start=0,end=len (str)) method counts the number of occurrences of a substring
#-*-coding:utf-8-*- Line="l want watch movie with you."Print(Line.center (50))Print(Line.ljust (50))Print(Line.rjust (50))#Center string Centered#Ljust String Left#rjust characters in the right#Lstrip Remove whitespace characters to the left of a
#-*-coding:utf-8-*-Strword="I'll fly with you and fly on the sky."#FindPrint(Strword.find ("Fly"))#Printing 7#Find returns a subscript that finds the first string, and cannot find the return-1Print("==rfind==")#RFindPrint(Strword.rfind
Title: Implementing string manipulation functions commonly used in Linux CTopic Analysis:First, the interview may often encounter such problems: such as strcpy, memcpy, strstrSecond, the reference to the Linux kernel code, to the Linux great God
1. Modify the case(1) Title () displays each word in uppercase, with the first letter of each word capitalized. This is useful,Because you often need to treat your name as information. For example, you might want the program to treat the value Ada,
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.