首页 > Web开发 > 详细

html textarea array 正则

时间:2019-11-19 18:26:07      阅读:82      评论:0      收藏:0      [点我收藏+]
      this.failIdsStr = ‘‘
      if (this.currentStatus === 3) {
        this.failIdsCount = this.tmpData.invalid_ids_count + this.tmpData.repeat_ids_count
        let tmpStr = (this.tmpData.invalid_ids + ‘,‘ + this.tmpData.repeat_ids).split(‘,‘).filter(Boolean)
        if (tmpStr.length > 0) {
          this.failIdsStr= tmpStr.join(‘\r\n‘)
        } 
      }

 

    changeMyTextarea(v) {
        let a = v.target.value
        let b = a.replace(/\n/g, ‘,‘)
        let c = a.split(/[\r\n]+/).join(‘,‘)

        let e = a
            .replace(/^[\r\n\s\uFEFF\xA0]+|[\r\n\s\uFEFF\xA0]+$/g, ‘‘)
            .split(/[\r\n]+/)
            .map(e => e.trim())
            .filter(Boolean)
            .join(‘,‘)
        console.log(‘a is..\n‘, a, ‘\nb is ..\n‘, b, ‘\ncis ..‘, c, ‘\ne is ..‘, e)
    },

 

html textarea array 正则

原文:https://www.cnblogs.com/dhjy123/p/11891122.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!