我的工作在我的COM的类一个任务,需要我创造的财富游戏的车轮。我目前正在研究getDisplayedPhrase
方法,我将解释。因此,对于这个节目,我有例如
"this is a question, thanks for helping!"
随机句话我想这句话改为
"**** ** * ********, ****** *** *******!"
这句话应该怎么看起来像他们想它。正如你所看到的,我想只改变字母,所以我创建了一个代替某些字符的字符串
private static final String alpha ="abcdefghijklmnopqrstuvwxyz"
,以避免任何标点符号。 这是我到目前为止有:
public String getDisplayedPhrase() {
for (int i = 0; i<secretPhrase.length(); i++){
I don't know what to put here and what method to use???
I'm thinking of using charAt() or indexOf()
}
return displayedPhrase;
}
而不是说我不知道,拿一个飞跃,并尝试使用的charAt()和的indexOf(),然后会被卡住。 – Arham