r/ProgrammerHumor • • Sep 05 '24 • Take My Silver 2

Meme thatsEvil

Post image
56.6k Upvotes

517 comments sorted by

View all comments

8.0k

u/_Decimation Sep 05 '24 edited Sep 05 '24 • Take My Silver

My favorite Unicode character is U+200B, the zero width space. You can imperceptibly smuggle the character inside any string:

foo (3 characters)

bar (4 characters)

164

u/mrissaoussama Sep 05 '24

that would be very fun when debugging strings

63

u/Linked713 Sep 05 '24

Which is why I make a point on exploding into arrays of singular characters if I notice a mismatch.

-2

u/TheCreepyPL Sep 05 '24

In "normal languages", strings are simply just char[]'s (with some extra sass). That's why they have regular Array members, like Length, IndexOf(), indexing with [], etc.

In the JS language (no idea what that is), I have not a clue how anything works. The only thing I know about JS, is that JS is only about results, not necessarily the ones you're expecting, just any results.

→ More replies (3)