How do I truncate any numbers of trailling identifier such as A 0r AAB or 1 etc)

I need to pass a variables that will receive values with trailling identifier to the database, such as
string name;;
where name at runtime could receive values such as
Global-com 1
Global - com 2
Chimon - Vacumm Fab 1A-A
Chimon - Vacumm Fab 1A-B
Chimon - Vacumm Fab 1A-C

Thanks Expert


ProjackAsked:
Who is Participating?
 
käµfm³d 👽Commented:
Assuming your identifiers will never have spaces in them:
name = name.Substring(0, name.LastIndexOf(' '));

Open in new window

0
 
ProjackAuthor Commented:
Thanks always and for been there expert kaufmed
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.