Discover string remove last character, include the articles, news, trends, analysis and practical advice about string remove last character on alibabacloud.com
Common syntax formats:foreach ($arr as $key = = $value) {$arr _str = $arr [' x_id ']. ‘,‘ . $arr _str;}Assume that the characters in the character array $arr areArr[0] = ' a ';Arr[1] = ' B ';ARR[2] = ' C ';Then, after the concatenation of the $arr
JS removes the punctuation marks at the end of the string and the method for deleting the last character. js punctuation marks
Requirement: remove the punctuation marks at the end of the js string.
Original string:
Hello World!
Target string:
Hello
String: string s = "1,2,3,4,5,"Goal: Delete the last ","Method:1, the most used is substring, this is what I have been usings = s.substring (0,s.length-1)2, with trimend, this thing is passed a character arrayS=s.trimend (', ')If you want to delete "
String: string s = "1,2,3,4,5,"Goal: Delete the last ","Method:1, the most used is substring, this is what I have been usings = s.substring (0,s.length-1)2, with trimend, this thing is passed a character arrayS=s.trimend (', ')If you want to delete "
Use substr () to remove the last character of the string
"," Must be used to separate the data in the statistical chart. However, when I use a loop to accumulate strings, it is inevitable that there will be one more ",". For example,
Php removes the usage of the last character substr () of the string. In today's project, remove the last character in the string from the original string 1, 2, 3, 4, 5, and 6. The final result is 1, 2, 3, 4, 5, and 6. the code is as follows: $ str
This article mainly introduces the implementation code for removing the first character and the last character from JS. If you need it, refer to it, I hope to help you with the "[lightinthebox]" character string, but I just need lightinthebox, that
In today's project, we used to remove the last character in the string, so we used substr. we sorted it out to help you learn it. Used in today's project to remove the last character in the string
Original String 1, 2, 3, 4, 5, 6,
Remove the last
Do some explaining.
The code is as follows
Copy Code
LEN (A2) –len (Substitute (A2, "", "") gets the number of strings in a hollow latticeSubstitute (A2, "", "-", STEP1) replaces the last space with the "-"Find ("-",
First, the preface
select()when you read a one-to-many amount of information from a database, you often need to split the retrieved array into a specific character and then concatenate it into a string.
Common syntax formats:
foreach
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.