Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

String function returning first x characters

Posted on 2004-10-25
6
Medium Priority
?
281 Views
Last Modified: 2008-03-06
what string function will return first x characters of the string in vb.net?
0
Comment
Question by:ftacoukj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 3

Accepted Solution

by:
nitrogenx earned 1000 total points
ID: 12406277
String.Substring(0,x)
0
 
LVL 3

Expert Comment

by:nitrogenx
ID: 12406279
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
ID: 12406283
uh thats a C# style comment just ignore after the //
0
 
LVL 3

Expert Comment

by:nitrogenx
ID: 12406299
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

610 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