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

Posted on 2009-04-24
Last Modified: 2013-12-17
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

Question by:Projack
    LVL 74

    Accepted Solution

    Assuming your identifiers will never have spaces in them:
    name = name.Substring(0, name.LastIndexOf(' '));

    Open in new window


    Author Closing Comment

    Thanks always and for been there expert kaufmed

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now