-1

Title says it all really, I just need to find out how to find the location of a space in a string.

1 Answers1

0

Strings have a .find method which you can use to find the first instance of a character:

x = "this contains a space"
print(x.find(" "))
Ian Moote
  • 851
  • 8
  • 15