[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

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

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

Open in new window

ProjackAuthor Commented:
Thanks always and for been there expert kaufmed

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now