Declaring isEmpty() and searchString() methods?

Hello! I am a first year CS student working on some code and am troubled by a couple methods. Everytime I try to use an isEmpty() or searchString() method, it says it is undefined while I am constantly seeing that it comes with a sort of package like String. Any help in getting this error fixed is greatly appreciated.
No description
No description
6 Replies
JavaBot
JavaBot5w ago
This post has been reserved for your question.
Hey @NieR Enthusiast! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
ayylmao123xdd
ayylmao123xdd5w ago
.isEmpty() needs to be called on a string so for example
String a = "a";
System.out.println(a.isEmpty());
String a = "a";
System.out.println(a.isEmpty());
NieR Enthusiast
NieR EnthusiastOP5w ago
Ironically, I figured that out 10 minutes after I posted the question 😭 that always tends to happen
ayylmao123xdd
ayylmao123xdd5w ago
so true ngl
MoonSouhayl
MoonSouhayl5w ago
oh god, comments between the method name and the code block
JavaBot
JavaBot5w ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server