Removing characters Right of a string character.

Posted on 2008-11-06
Last Modified: 2009-06-16
Hello, Im using classic ASP and I need to be able to remove characters Right of a string character.

String text: NJ5496727738B5/5

I need to remove the / and any characters after that from the string before I can quary the Database. Also, take that number after / and throw that into a new string.
Question by:inrworx
    LVL 82

    Expert Comment

    Dim data
    data ="NJ5496727738B5/5";


    Response.Write( data[0] ) 'contains the string to the left of the slash
    Response.Write( data[1] ) 'contains the string to the right of the slash
    LVL 2

    Accepted Solution

    Hielo is right, except ASP Classic arrays use () and not [].

    It would be data(0).

    If you use a [], you'll get one of these:

    Error Type:
    Microsoft VBScript compilation (0x800A03EE)
    Expected ')'
    LVL 82

    Expert Comment

    >>except ASP Classic arrays use () and not [].
    LOL. Yes of course. I typically code my asp pages in javascript. Hence my "bad habit" :)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    734 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

    22 Experts available now in Live!

    Get 1:1 Help Now