I am attempting to create a parse function that takes in a string and returns an array. So far I am having a problem with my array declaration:
var sArray = sfunctions.ParseThis(ctrlValue);
ctrlValue = sArray[0]; // Get the first string from the array
rValue = sNew[1];
I have also tried:
string [] sArray = sfunctions.ParseThis(ctrlValue);
In my old c programming days I could declare an array and it would live outside a function without passing anything but a reference, just not sure how to do that in c# or coded ui test.
Thanks for assistance.
control.ClickCustomControl(parent, "InnerText", "Register-16");
where ctrlValue = "Register-16"
And - other answers:
public Array ParseThis(string sToParse)
{
char cSplit = '-';
string[] sNew = sToParse.Split(new char[] { cSplit });
return sNew;
}
ParseThis()function? Both samples you posted will work just fine if that function is declared and implemented properly.ParseThisand the value ofctrlValue.