
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Convert Integer Array to String Array in C#
Use the ConvertAll method to convert integer array to string array.
Set an integer array −
int[] intArray = new int[5]; // Integer array with 5 elements intArray[0] = 15; intArray[1] = 30; intArray[2] = 44; intArray[3] = 50; intArray[4] = 66;
Now use Array.ConvertAll() method to convert integer array to string array −
Array.ConvertAll(intArray, ele => ele.ToString());
Let us see the complete code −
Example
using System; using System.Text; public class Demo { public static void Main() { int[] intArray = new int[5]; // Integer array with 5 elements intArray[0] = 15; intArray[1] = 30; intArray[2] = 44; intArray[3] = 50; intArray[4] = 66; string[] strArray = Array.ConvertAll(intArray, ele => ele.ToString()); Console.WriteLine(string.Join("|", strArray)); } }
Output
15|30|44|50|66
Advertisements