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
Release: 2016-05-16 17:18:02
Original
1252 people have browsed it

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)

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template