how to truncate to get the 1st 5 chars from a string

Discussion in 'Python' started by MacRules, Sep 24, 2009.

  1. MacRules

    MacRules Guest

    s="1234abcd"
    s.range(0..4)
    1234a

    Is there a string function like this?

    Thanks
     
    MacRules, Sep 24, 2009
    #1
    1. Advertisements

  2. Grant Edwards, Sep 24, 2009
    #2
    1. Advertisements

  3. MacRules

    Donn Guest

    Donn, Sep 24, 2009
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stimp
    Replies:
    2
    Views:
    793
    Stimp
    Oct 27, 2006
  2. Kosio

    Floats to chars and chars to floats

    Kosio, Sep 16, 2005, in forum: C Programming
    Replies:
    44
    Views:
    1,874
    Tim Rentsch
    Sep 23, 2005
  3. Katie

    Smart String truncate

    Katie, Apr 20, 2007, in forum: Java
    Replies:
    2
    Views:
    889
    Daniel Pitts
    Apr 20, 2007
  4. David C

    DirectoryExists on 1st 4 chars

    David C, Nov 16, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    398
    David C
    Nov 19, 2007
  5. Hongyu
    Replies:
    9
    Views:
    1,260
    James Kanze
    Aug 8, 2008
  6. Alessio

    Truncate a string using printf

    Alessio, Nov 16, 2009, in forum: C Programming
    Replies:
    9
    Views:
    13,266
    Eric Sosman
    Nov 16, 2009
  7. Stefan van Kessel

    Re: Truncate a C++ string

    Stefan van Kessel, Sep 21, 2010, in forum: C++
    Replies:
    3
    Views:
    5,640
    James Kanze
    Sep 22, 2010
  8. M.Posseth

    receiving ??? chars instead of "special" chars

    M.Posseth, Nov 15, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    517
    Dan Rogers
    Nov 16, 2004
Loading...