我想截断输入的值

时间:2019-12-05 17:20:39

标签: javascript reactjs

您好,我想在this.setState中使用子字符串

selectMultipleOptionInvestor(value) {
    const maxStrLength = 25;
    this.setState(
      {
        investorsSelected: value.length > maxStrLength ? value.substring(0, maxStrLength) : value,
      },
      () => console.log(value),
    );
  }

0 个答案:

没有答案