Splitting in string in JavaScript

前端 未结 3 1397
忘掉有多难
忘掉有多难 2021-01-25 06:50

How to split a string in JavaScript with the \",\" as seperator?

3条回答
  •  无人共我
    2021-01-25 07:35

    var expression = "h,e,l,l,o";

    var tokens = expression.split("\,");

    alert(tokens[0]);// will return h

提交回复
热议问题