📜 ⬆️ ⬇️

Assword

One of the most amazing code examples I've ever seen.
As stated in the comment, this code tries to find the substring “Nothing”, “Successful”, “Password” or “Failed” in the string, and the first letter case is not important.

protected void parseSummaryLines()
{
...

// NOTE: First letters are ommited in order to
// support capitalized words as well
String RESULT_GOOD_TEXT_1 = " othing "; // Nothing
String RESULT_GOOD_TEXT_2 = " uccessful "; // Successful
String RESULT_BAD_TEXT_1 = " assword "; // Password
String RESULT_BAD_TEXT_2 = " failed "; // Failed

...
}


You can treat it differently. On the one hand, it can be seen in this shit . On the other hand, this is a simple and concise solution that copes with the task.
')
But in any case, the resulting “Zhopislovo” is a masterpiece ...

Source: https://habr.com/ru/post/114173/


All Articles