首页 > 解决方案 > How to seperate elements of string by space Java Script

问题描述

I am trying to add spaces at specific indexes of my string. For example "21+2-32*2" into "21 + 2 - 32 * 2", but it can't be "2 1 + 2 - 3 2 * 2. I know that what I need to do is add spaces before and after math signs, but I don't know how to realize it in Java Script.

Thank you in advance

标签: javascriptstringseparator

解决方案


推荐阅读