+ 3
What is the output of the following code?
Sop("Hi, ABC, good".matches("ABC ")+" "); Sop("Hi, ABC, good".matches(".*ABC.*")); Output: false true How this code works? Please help!
4 Respuestas
+ 2
SHREYA UPADHYAY.
In the first code, in String there is no space after ABC but in the matches method there is space after ABC. So it return false.
In the second code there is no space in String but there is .* before and after the ABC in matches method. Here .* ignore everything and returns true.
+ 1
AJ #Learn With Me 👨💻 thank you very much 😊
+ 1
Coder Kitten thank you very much 😊