我是全新的,完全丟失。我正在尋找一個教程或資源,可以向我解釋如何執行此操作:條件邏輯和字符串操作在JAVA
爲每個展開的縮寫輸出一條消息,然後輸出展開的行。
例如,
Enter text: IDK how that happened. TTYL.
You entered: IDK how that happened. TTYL.
Replaced "IDK" with "I don't know".
Replaced "TTYL" with "talk to you later".
Expanded: I don't know how that happened. talk to you later.
我知道該怎麼做了userText.replace
部分改變IDK
到I don't know
,但我不知道如何將它設置爲搜索的字符串爲IDK
爲什麼你需要搜索自己? '替換'已經搜索並替換你.... – Li357
我會建議看看HashMap爲:https://docs.oracle.com/javase/8/docs/api/java/util/ HashMap.html –
不確定,正如我所說,不知道我在做什麼,但我知道我應該使用條件格式和idk如何做到這一點 –