hey i have a 2D char array x[5,5]. now i have to convert each row into a string for some manipulation. i have tried this one but returned errors.
for (int i = 0; i < 5;i++ ){
string str= new string( x[i, j] );
}
thanks
hey i have a 2D char array x[5,5]. now i have to convert each row into a string for some manipulation. i have tried this one but returned errors.
for (int i = 0; i < 5;i++ )}
thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Alok UniyalRank #8,369 · 223 reputationPosted Oct 23, 2012, 2:51 AM EDT
Try this
for(int i=0;i<5;i++)
{
string str="";
for(int j=0;j<5;j++)
{
str+=x[i][j];
}
}
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Oct 23, 2012, 2:56 AM EDT
This strlist will be a list of string and it will hold all the 5 converted strings
binod km5 reputationPosted Oct 23, 2012, 3:05 AM EDT