Solved

String function returning first x characters

Posted on 2004-10-25
232 Views
Last Modified: 2008-03-06
what string function will return first x characters of the string in vb.net?
0
Question by:ftacoukj
    4 Comments
     
    LVL 3

    Accepted Solution

    by:
    String.Substring(0,x)
    0
     
    LVL 3

    Expert Comment

    by:nitrogenx
    thats actually a function of a string object:

    Dim x As Int32 = 3
    Dim str As String = "I'm a string"
    str.SubString(0,x) // I'm
    0
     
    LVL 3

    Expert Comment

    by:nitrogenx
    uh thats a C# style comment just ignore after the //
    0
     
    LVL 3

    Expert Comment

    by:nitrogenx
    I tested it with the following code:

        Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim x As Int32 = 3
            Dim str As String = "I'm a string"
            Response.Write(str.Substring(0, x))
        End Sub
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    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.
    This video Micro Tutorial is the second in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles a…
    Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

    856 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

    17 Experts available now in Live!

    Get 1:1 Help Now