-4

I receive an input like this

x= (a:b)

I need to separate a and b and use them individually in the code

a = abc1*xyz1

b = abc2*xyz2

How can I separate two or more entities which are delimited by ":" and use them separately later in the code?

user2985124
  • 53
  • 1
  • 1
  • 6

1 Answers1

0

If it is processed as a string:

a = inputstring.split('(')[1].split(':')[0]
b = inputstrint.split(':')[1].split(')')[0]

This will split the values out of the strings based on the provided delimiters.

David Scott
  • 796
  • 2
  • 5
  • 22