Results 1 to 5 of 5

Thread: Left

  1. #1

    Thread Starter
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196

    Left

    Does C# have an equivalent it vb6's Left(string,length) function?
    "And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
    Frank Zappa

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Use the SubString() method passing in the arguments to get what you want.

    string myString = "Hello";
    myString = myString.SubString(1,2);

  3. #3
    Lively Member
    Join Date
    Sep 2002
    Posts
    100
    If you want to get the first letter you have to start at 0.

    Mitchel

  4. #4

    Thread Starter
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196
    Cool, Thanks!
    "And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
    Frank Zappa

  5. #5
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Originally posted by toto
    If you want to get the first letter you have to start at 0.

    Mitchel
    Ya, I was just showing that you throw in two arguments. Everything is 0 based in C#, just assumed he would know.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width