Substring Function Issue

Hi team,
I am facing issue while using Substring Function in AE 18.0.
Earlier the following piece of code was working fine, but now, test run is getting failed: -

Str = “In Process (75)”
a = Str.IndexOf("(")
b = Str.IndexOf(")") // where a, b are Int32 type arg. Till this step, it’s working fine
Str1 = Str.Substring(a,b) // Showing error

When I am using, Str1 = Str.Substring(a) , it is working fine
But when I give both start index and length, it is getting failed even if I am using Substring(–,--) as per suggestion by AssistEdge.

Please help me with the same.

Issue Resolved. It was because of “Out of bound” exception caused by variable b’s value.