How to remove part of a string?

后端 未结 7 1553
夕颜
夕颜 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:05

    string = "removeTHISplease";
    result = string.replace('THIS','');
    

    I think replace do the same thing like a some own function. For me this works.

提交回复
热议问题