How to count the number of characters without spaces?

前端 未结 3 1120
渐次进展
渐次进展 2020-12-06 14:23

I\'m new to this, so please understand me;/

I\'m creating an app in appery.io and it has to count the number of letters of text inserted by the app user(without spac

3条回答
  •  自闭症患者
    2020-12-06 14:51

    Use this:

    var myString = getElementById("input").value;
    var withoutSpace = myString.replace(/ /g,"");
    var length = withoutSpace.length;
    

提交回复
热议问题