Click here to Skip to main content
15,907,001 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
for (int i = 0; i < StdRegNo.Count; i++)
            {
                string timeLine = StdRegNo[i] + "_Timeline";
            }
Posted
Updated 17-Feb-14 16:55pm
v6

Try this :
C#
...
string timeLine = StdRegNo[i].ToString() + "_Timeline";
...
 
Share this answer
 
Comments
[no name] 17-Feb-14 4:14am    
Its not working..
Mehdi Gholam 17-Feb-14 4:19am    
What is "not working"?
[no name] 17-Feb-14 4:22am    
After concatenating

string timeLine = StdRegNo[i].ToString() + "_Timeline";

i need Output as NA001_Timeline

which i am not getting
Mehdi Gholam 17-Feb-14 4:27am    
... and what are you getting?
[no name] 17-Feb-14 4:29am    
i am getting just "_Timeline"
Not clear what the exact output you want.

But,
C#
ArrayList StdRegNo = new ArrayList();
StdRegNo.Add("123");
StdRegNo.Add("456");

for (int i = 0; i < StdRegNo.Count; i++)
{
    string timeLine = StdRegNo[i] + "_Timeline";
}


will give, first, 123_Timeline then 456_Timeline.

Add() takes an object as the parameter. So, be careful what you put there. For your case, this has to be a string or some numeric type.
 
Share this answer
 
Comments
[no name] 17-Feb-14 4:15am    
this is not working ..
i have already added values to StdRegNo

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900