Home >Web Front-end >JS Tutorial >Using Substring to delete the last character of a string in JavaScript_javascript tips

Using Substring to delete the last character of a string in JavaScript_javascript tips

WBOY
WBOYOriginal
2016-05-16 17:18:021254browse

String str = "a,b,c,";

We need to delete the last English comma, what should we do?

Method:

1. Substring

str=str.Substring(0,s.Length-1)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn