The output of a call to String.Split
is an array of strings (String[]
). What your code does, here, is attempting to assign a String[]
to a String
variable, therefore the application is throwing an exception.
Hence, you must identify, within your array, the value you are looking for and picking the index that points to it (from 0
to suptime.Length - 1
). For example:
UpTime.Text = suptime[0]; // first value of the array
UpTime.Text = suptime[2]; // third value of the array
UpTime.Text = suptime[suptime.Length - 1]; // last value of the array
If the result of your split is:
{"A" "Z" "11:57"}
and you want your UpTime.Text
to be filled with something that looks like a time value, it's kinda obvious that the value you must pick is the third one.