How to remove part of a string?

后端 未结 7 1521
夕颜
夕颜 2020-11-30 23:16

Let’s say I have test_23 and I want to remove test_.

How do I do that?

The prefix before _ can change.

相关标签:
7条回答
  • 2020-12-01 00:09

    I wanted to remove "www." from a href so I did this:

    const str = "https://www.example.com/path";
    
    str.split("www.").join("");
    
    // https://example.com/path
    
    0 讨论(0)
提交回复
热议问题