Results 1 to 4 of 4

Thread: string

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    string

    the cobe below grabs the the last 8 characters of my string. I need the first 8 characters...anyone know how I can grab the first 8 characters?

    thanks

    VB Code:
    1. tranperiod = tranperiod.Substring(tranperiod.Length - 8)
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    tranperiod = tranperiod.Substring(0, 8)

    Something like that. It is a overloaded method. You should be able to set the start index, and the length.

  3. #3
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    How about

    VB Code:
    1. tranperiod = tranperiod.Substring(1, 8)
    This world is not my home. I'm just passing through.

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    hellswraith is correct 0,8.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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