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
  • 96,782
  • 12
  • 124
  • 169
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
  • 24,595
  • 5
  • 38
  • 66