How to convert string myArray[310,120] to int myArray[310,120]

Hi,
how to convert string myArray[310,120] to int myArray[310.120]
or
string myArray[310,120] to int myArray2[310,120]
and
int myStringArray[310,120] to myIntArray[310,120]
.

Best Regards,
ocaccy
ocaccyAsked:
Who is Participating?
 
sachinpatil10dConnect With a Mentor Commented:
Try this
string[] strings = new[] { "310", "120" };
int[] ints = strings.Select(x => int.Parse(x)).ToArray();

Open in new window

0
 
ocaccyAuthor Commented:
Thank you sachinpatil10d.

Are multidimensional arrays in C #.

How to convert intArray [10,10] to stringArray[10,10]
and stringArray[10,10] to intArray [10,10]?
0
 
sachinpatil10dConnect With a Mentor Commented:
Try this

            string[] strings = new[] { "10", "10" };
            int[] ints = strings.Select(x => int.Parse(x)).ToArray();
            string[] newstrings = ints.Select(y => Convert.ToString(y)).ToArray();

Open in new window

0
 
ocaccyAuthor Commented:
Forgive me,  and very grateful for the attention.

The array has 10 columns and 10 rows.

Regards,
ocaccy
0
 
ocaccyAuthor Commented:
Very good, this comments solves my problems.
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.