分割字符串更改數目爲字符串JavaScript的,每長度
ex)
721,011 => seven hundred twenty-one thousand eleven
21,011 => twenty-one thousand eleven
,我發現每三個詞
https://gist.github.com/hendriklammers/5231994
但它是在第一個字splited分裂
721,011 => [721, 011] (It is perfect)
21,011 => [210, 11] (It is not perfect, wanna [21, 011])
2123011 => [212, 301, 1] (It is not perfect, wanna [2, 123, 011])
21230ef11 => [212, 301, 1] (It is not perfect, I'll accept only integer , wanna [2, 123, 011]), (using fucntion num.toString().replace(/\D/g, ""))
如何分割字符串的長度?
它是唯一的反向字符串和re reversing?
請顯示您的代碼。 – Barmar 2014-12-11 02:45:25
@Barmar現在我開始開發並找到如何拆分單詞 – kai 2014-12-11 02:51:36
「每個長度拆分字符串」根本不清楚你想要的。請爲幾個不同的輸入顯示樣本輸入和所需的輸出。 – jfriend00 2014-12-11 02:51:57