ASP to remove the last comma-empty string code _ Application Tips

Source: Internet
Author: User

How to replace the last comma with an empty string in ASP
For example Aaa,bbb,ccc,eee, this string

How to make the last comma change no, the other does not change AH
Question added: For example aaa,bbb,ccc,eee, this string

How to make the last comma change no, the other does not change AH
If it's aaa,bbb,ccc,eee, it doesn't change.

<% 
str= "aaa,bbb,ccc,eee," 
if Right (str,1) = "," Then 
str=left (Str,len (str)-1) End 
if 

The ASP right function returns a specified number of characters from the right-hand side of the string.

Tip: To determine the number of characters in the string argument, use the Len function

Tip: You can also refer to the lower left function

Grammar
Right (String,length)

Parameter description
String
Required option. A string expression whose rightmost character is returned.
Length
Required option. Numeric expression that indicates the number of characters to return. Returns a 0-length string if 0, or the entire string if the number is greater than or equal to the number of all characters in the string argument.

Instance 1

Dim txttxt= "This is a beautiful day!" 
Response.Write (Right (txt,11)) 

Instance 2

Dim txttxt= "This is a beautiful day!" 
Response.Write (Right (txt,100)) 

Instance 3

Dim txt,xtxt= "This is a beautiful day!" X=len (TXT) 
Response.Write (Right (TXT,X)) 

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.