#Reliable, platform independent newline splitter in gleam
1 messages · Page 1 of 1 (latest)
What's that?
A uniform function to split a string on newlines as different platforms split differently like \r\n on windows and \n on linux/mac
Just a nice api so you don't have to think about the host platform
.NET keeps a neutral stance and just does \n for unix and \n\r for non unix platforms
Aye, I was asking what should it do when you cannot tell what platform you're running on?
Not knowing is probably non unix then?
It's tricky
The main one is in a browser
Wait we could check window.navigator.platform
Nice
OK so I think that's practically enough for everything
My favourite thing is checking if someone is on windows and changing the breadcrumbs from Home / Etc / Etc to Home \ Etc \ Etc
such a silly design that OS
In C# you can use Path.Combine("Home", "Etc", "Etc") to create a path with the correct slash
You can do that in most langs, I was talking about UI in a browser
For ex. I have a project with a team switcher that looks like this on Windows
And this everywhere else
why does is matter in a web ui?
It's just a neat easter egg
ahh i see
Like Louis said, it's cute 😂
I didn't know that was called breabcrumbs
Breadcrumbs is the name for the thing you see sometimes that shows the path to the current page, like this
people who don't know about hansel and gretel are going to be so confused lmao.