Split function
-
Dim chrEachCharOut() As String = Split(txtAcctInXor.Text, "^") For Each chrSet In chrEachCharOut ‘do stuff here Next txtAcctInXor.Text contains 14^7^26^90 After the Split, chrEachCharOut has a length of 5. I was expecting 3 since the split returns a zero-based array containing the substrings. Why is the length 5? If I step thru the code I see 14, then 7, then 26, then 90, then I receive the following error -'System.InvalidCastException' occurred …”….Additional information: Cast from string "" to type 'Integer' is not valid. I only want the information between the ^ to be returned to me. Any ideas? All help appreciated!
-
Dim chrEachCharOut() As String = Split(txtAcctInXor.Text, "^") For Each chrSet In chrEachCharOut ‘do stuff here Next txtAcctInXor.Text contains 14^7^26^90 After the Split, chrEachCharOut has a length of 5. I was expecting 3 since the split returns a zero-based array containing the substrings. Why is the length 5? If I step thru the code I see 14, then 7, then 26, then 90, then I receive the following error -'System.InvalidCastException' occurred …”….Additional information: Cast from string "" to type 'Integer' is not valid. I only want the information between the ^ to be returned to me. Any ideas? All help appreciated!
Hi nug. Are you sure that
txtAcctInXor.Text
contains "14^7^26^90" and not "14^7^26^90^" with an extra "^" at the end? -
Hi nug. Are you sure that
txtAcctInXor.Text
contains "14^7^26^90" and not "14^7^26^90^" with an extra "^" at the end? -
It happens to the best of us ;)