Print array without brackets and commas

后端 未结 10 782
囚心锁ツ
囚心锁ツ 2020-11-29 23:28

I\'m porting a Hangman game to Android and have met a few problems. The original Java program used the console, so now I have to somehow beautify the output so that it fits

10条回答
  •  孤独总比滥情好
    2020-11-30 00:19

    the most simple solution for removing the brackets is,

    1.convert the arraylist into string with .toString() method.

    2.use String.substring(1,strLen-1).(where strLen is the length of string after conversion from arraylist).

    3.Hurraaah..the result string is your string with removed brackets.

    hope this is useful...:-)

提交回复
热议问题