Created
May 4, 2012 19:12
-
-
Save fushihara/2597093 to your computer and use it in GitHub Desktop.
join用の配列を作らずに文字列をjoinする ref: http://qiita.com/items/e04937a6f53df0f2058e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data=["あ","い","う"]; | |
res="";join=" "; | |
for(i=0;i<data.length;i++){ | |
res+=(res!="")?join:""; | |
res+=data[i]; | |
} | |
res; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment