Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   How to join the string after splitting (http://www.go4expert.com/forums/join-string-splitting-t26439/)

spurthy04 4Aug2011 13:45

How to join the string after splitting
 
HI,

I have code where i've split the string "abc,cde,xyz" to abc cde and xyz using strtok.

Now, I want to join it by adding single quote to each tokenised value.
like 'abc','cde','xyz'.

Can anyone help me ?

Thanks,

xpi0t0s 5Aug2011 13:14

Re: How to join the string after splitting
 
Code:

sprintf(joined_string,"'%s','%s','%s'",str1,str2,str3);


All times are GMT +5.5. The time now is 01:12.