+ 5

Strange output

I know this question is not programming related. But I found a strange issue and don't know where it comes from. I run this code: https://code.sololearn.com/cfQL7xwd5Va3/?ref=app output: 3 5 7 8 2 1 (between the numbers is a white space) my output using the app: 3 57821 (only one white space between 3 and 5) Using the code playground on the website I see what I should see. Do I have troubles with my Smartphone? (Samsung Galaxy S3 i9300, android: 4.3) Or do I have troubles with the app? Is my smartphone to old for using the app? Or has it to do with the code and my smartphone? My question now is whether that can happen to me with my own codes (Java) as well. Since I am still in the learning phase, it would be quite possible that I think my code is wrong, but the problem is quite another. Would be glad about advice. Thank you

19th Feb 2019, 7:54 PM
Denise Roßberg
Denise Roßberg - avatar
3 Respostas
+ 3
Denise Roßberg "\t" is not a regular expression, but rather the scape sequence for a horizontal tab.
19th Feb 2019, 9:00 PM
Diego
Diego - avatar
+ 2
Bennett Post "I personally have never been a supporter of the idea to use '\t' for output formatting. It is unreliable, per terminal customisable and never gets you the output that you want (and most likely looking differently for every user). " So we can say there exists some regular expressions ("\t" is a regular expression, right?) which can look differently for different users? Am I right that I would also get troubles in Java using "\t"? Thank you for your help. :)
19th Feb 2019, 8:52 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Diego Thank you.
19th Feb 2019, 9:03 PM
Denise Roßberg
Denise Roßberg - avatar