I have a string such as

"this is a really long string that is completely pointless. But hey who cares!

and I was wondering if there was a way to cut the first X characters off and return the res of the string

Python string are immutable so delete it wont work.
You can replace it first character with nothing ''.

>>> s = "this is a really long string that is completely pointless. But hey who cares!"
>>> s.replace(s[0], '')
'his is a really long sring ha is compleely poinless. Bu hey who cares!'

Another way is make it a list and the do stuff you need,and take it back into a string again.

>>> s = "this is a really long string that is completely pointless. But hey who cares!"
>>> s = list(s)  #Make it a list
>>> del(s[0])    #Delete first character
>>> ''.join(s)   #Take it back to a string
'his is a really long string that is completely pointless. But hey who cares!'

Edited 5 Years Ago by snippsat: n/a

Here you go duddy :)

dd= "this is a really long string that is completely pointless. But hey who cares!".split(" ")
dd[0]=''
print " ".join(dd)
##out
is a really long string that is completely pointless. But hey who cares!

Edited 5 Years Ago by richieking: n/a

Common idiom is to construct fresh string using slicing. That is assigned to old variable if it is not needed anymore. This can be further developed by doing the string generation in generator expression we can pass to join method producing suitably joined new string.

Edited 5 Years Ago by pyTony: n/a

This question has already been answered. Start a new discussion instead.