Ask coding questions

← Back to all posts
Reposting my previous question...
LukeWright (287)

whenever I use any method to remove the hastag from message.author, whether it be split, len, for loop, find, rfind, or splicing, i get this error:

can someone help me?

Answered by robowolf (549) [earned 5 cycles]
View Answer
Comments
hotnewtop
robowolf (549)

you have to do str(message.author) on line 23. Also I think you have to make it a list using the list() function.

19ecal (232)

To remove a "#" from the front of a string, you can do

string="#hello"
removed=string.lstrip("#")