0

I have the following string:

string_a = 81^A55

from which I'm trying to get the following list

string_a_int = [81,55]

I'm able to split the string into a list made by numbers as follows

list_only_number = re.split('[A-Z]+', string_a)

list_only_numbers = [81^, 55]

but I'm trying to figure out how to skip also the ^.

Any help would be much appreciated.

user123892
  • 1,243
  • 3
  • 21
  • 38
  • https://stackoverflow.com/a/4289348/3832970 – Wiktor Stribiżew Feb 06 '20 at 13:34
  • Note that `^A` is the [caret-notation](https://en.wikipedia.org/wiki/Caret_notation) of the `\x01` / SOH / Start Of Header control character. It seems likely to me that you should be handling a string that contains that actual character rather than its caret notation, at which point you could simply split over that character. – Aaron Feb 06 '20 at 13:53

0 Answers0