如何从字符串中取出数字?

首先定义一个字符串 'recipientsInfo[11]'

1、'recipientsInfo[11]'.replace(/[^\d]/g, '');

2、`recipientsInfo[11]`.match(/\d+/g);

posted @ 2020-08-28 10:31  程序員劝退师  阅读(711)  评论(0)    收藏  举报