is there an equivalent for string concatination in vbscript that can substract a string

Posted on 2006-03-29
Last Modified: 2008-01-09
I have a string A :
I have a string B

I want to have the string 123 returned.

I want to do this in vbscript
Question by:itbabe
    LVL 142

    Accepted Solution

    something like
    replace( A, B, "")
    should do the work...
    LVL 8

    Assisted Solution

    These links would be very useful to you:

    "Parsing strings in ASP using VBscript functions"


    InStr(StringToSearch, StringToFind)
    The Function will return the position of the first occurence of StringToFind within StringToSearch. The Function will return 0 if StringToFind is not found.


    The Left Function
    Syntax: Left(String, NumofCharactersToGetFromString)

    The Function will return the number of characters you stipulate. As is obvious it starts from the left.


    response.write "The first 3 letters of my name are " & Left(String1,3)
    The first 3 letters of my name are Mic


    Replace VBScript function
    The Replace function can be used to replace certain characters within a string with other characters.

    Syntax:Replace(StringToSearch, StringToFind, ReplaceWithThisString)

    StringtoSearch is the string you want to check for any occurence of the StringToFind. If there are any occurences of StringToFind then the function will replace them with ReplaceWithThisString. Every occurence will be replaced starting from the first character of StringToSearch.


    Response.write Replace(String1,"_"," ")
    Result displayed on the screen would be:
    My Name is Michael



    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    modThree challenge 4 53
    sameEnds challenge 25 57
    userCompare  challenge 3 55
    word0 challenge 4 38
    Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    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

    16 Experts available now in Live!

    Get 1:1 Help Now