We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
can anybody tell me why trim() is required at all? the regex can handle the leading and trailing spaces but still when i am not using trim(), my code fails on a few test cases even after producing the exact same output as required for those cases! kinda confused
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java String Tokens
You are viewing a single comment's thread. Return to all comments →
can anybody tell me why trim() is required at all? the regex can handle the leading and trailing spaces but still when i am not using trim(), my code fails on a few test cases even after producing the exact same output as required for those cases! kinda confused