|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
problem with join()I have a two-dimension array with integers and i want to join it into a string. See my code: dim va(10,5) as integer dim mystring as string .... for j=1 to 10 for k=1 to 5 mystring = Join(";",va(j,k).ToString) next next The error i get is: "value of type string cannot be converted to 1-dimensional array of string" Thanks for help André André wrote:
Show quoteHide quote > Hi, well, thakes a string and a 1-dimensional array. By calling .ToString> > I have a two-dimension array with integers and i want to join it into a > string. See my code: > dim va(10,5) as integer > dim mystring as string > ... > for j=1 to 10 > for k=1 to 5 > mystring = Join(";",va(j,k).ToString) > next > next > > > The error i get is: "value of type string cannot be converted to > 1-dimensional array of string" > > Thanks for help > André you calling it with a string and a string - not an array. Hence your error. Of course, you can't call it with a 2D array anyway. So, your probably going to have to do this manually. I would look at using System.Text.StringBuilder to build your string. -- Tom Shelton Thanks
"Tom Shelton" <tom_shel***@comcast.net> schreef in bericht André wrote:news:1164816485.335652.257450@80g2000cwy.googlegroups.com... Show quoteHide quote > Hi, well, thakes a string and a 1-dimensional array. By calling .ToString> > I have a two-dimension array with integers and i want to join it into a > string. See my code: > dim va(10,5) as integer > dim mystring as string > ... > for j=1 to 10 > for k=1 to 5 > mystring = Join(";",va(j,k).ToString) > next > next > > > The error i get is: "value of type string cannot be converted to > 1-dimensional array of string" > > Thanks for help > André you calling it with a string and a string - not an array. Hence your error. Of course, you can't call it with a 2D array anyway. So, your probably going to have to do this manually. I would look at using System.Text.StringBuilder to build your string. -- Tom Shelton
How do you translate your WinForms app? (outsourcing localization)
how to make cookies into an array? How to recognize a Command Line parameter? Looking for a simple explanation of how to walk through a dataset in .net 2.0 Logic Troubles - reading in a difficult textfile Its Urgent: I have export database into excel file if office not installed then it gives me error Convert today's date and time to a long Add new record to database Where is the VS mru list file stored? Transparent Picture boxes |
|||||||||||||||||||||||