string trim numbers

R

RobcPettit

Hi, using 'mystring = "Robert 123 \par" , Ive used char[] MyChar =
{ '\\', 'p', 'a', 'r', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'0', ':'}; string newstring = mystring.TrimEnd(MyChar);
to trim it. It returns "Robert 123". How can I trim the numbers also.
Regards Robert
 
S

Scott M.

Would this work instead of what you've done:

string s = "Robert 123 \par";
s = s.split(" ")[0];

-Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top