[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

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
0
ocaccy
Asked:
ocaccy
  • 3
  • 2
2 Solutions
 
sachinpatil10dCommented:
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
 
sachinpatil10dCommented:
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now