468,305 Members | 1,475 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,305 developers. It's quick & easy.

Concatenating/Appending the list of elements

440 256MB
Hi

Is it possible to Concatenate/Append list of elements into a single string as shown below ?

I/P:

list = ['ID','1','1','2']

O/P:

'ID112'

I dont want to travese the individual element by element in a list and concatenate the string to get the final string

-PSB
May 1 '07 #1
2 4865
psbasha
440 256MB
If not list,is it possible with strings to ge the output?.

-PSB
May 1 '07 #2
bvdet
2,851 Expert Mod 2GB
Hi

Is it possible to Concatenate/Append list of elements into a single string as shown below ?

I/P:

list = ['ID','1','1','2']

O/P:

'ID112'

I dont want to travese the individual element by element in a list and concatenate the string to get the final string

-PSB
Expand|Select|Wrap|Line Numbers
  1. >>> s = ['ID','1','1','2']
  2. >>> ''.join(s)
  3. 'ID112'
  4. >>> 
May 1 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by bucket79 | last post: by
2 posts views Thread by Shaurya Vardhan | last post: by
1 post views Thread by Ron Adam | last post: by
5 posts views Thread by toton | last post: by
1 post views Thread by csharpula csharp | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.