Get only numbers from string

前端 未结 8 596
耶瑟儿~
耶瑟儿~ 2021-01-01 15:37

i want to get only numbers from string.

Lest say that this is my string :

324ghgj123

i want to get:

324123
8条回答
  •  抹茶落季
    2021-01-01 16:14

    For a linear search approach you can use this algorithm, it’s in C# but can easily be translated in vb.net, hope it helps.

    string str = “123a123”;
    
    for(int i=0;i

提交回复
热议问题