I need to split the value of x and y
For ex:{X=160,Y=220,Width=1122,Height=334}
Output should be 160
And second output should be 220
Hi @sruthesanju
Split based on equals sign
split(yourvariable,β=β)
You arrayvalue(1) contains your string value.
Regards
Hello,
yourString.Split(",βc)(0).Split(β="c)(1).ToString gives X.
yourString.Split(",βc)(1).Split(β="c)(1).ToString gives Y.
Hope it helps !
Hi @sruthesanju
you can use Split Function to split the string using the comma
YourString.Split(",βc)(0).Split(β=βc)(1).ToString β The output is: 160
YourString.Split(β,βc)(1).Split(β=βc)(1).ToString β The output is: 220
YourString.Split(β,βc)(2).Split(β=βc)(1).ToString β The output is: 1122
YourString.Split(β,βc)(3).Split(β="c)(1).ToString β The output is: 334
Or you can use Substring function.
YourStringVariable.Substring(StartIndex,Length)
For Example: you have the string variable: MyText = βHello Worldβ
MyText.Substring(0,2) -->This gives you the output: He
MyText.Substring(0,4) -->This gives you the output: Hell
MyText.Substring(3,2) -->This gives you the output: lo
For your string: βX=160,Y=220,Width=1122,Height=334β
MyText.Substring(2,3) -->This gives you the output: 160
MyText.Substring(8,3) -->This gives you the output: 220
Best regards
Mahmoud
Your case looks like the text representation of a variable of Datatype Rectangle displayed e.g. in Locals / Watch immediate panel or ToString method.
In such case we can get the value directly from the property by the API
Have look here:
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.