0

Is there a function similar to toCharArray(c#) in python? I know there aren't chars in python, but is there a similar data type? Or is there a way to break a string up into smaller, one digit strings?

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
ErgonomicGrip
  • 15
  • 1
  • 2

1 Answers1

0

Assuming by char array, you mean a set of integers (as opposed to one-character strings), then you would do the following:

list(mystring.encode())

(for python3)

mdurant
  • 27,272
  • 5
  • 45
  • 74