satoru
I’m working on the “Bob” exercise on the Elixir Track in Exercism.
I am testing for uppercase letter with this simple check: c in ?A..?Z, but one of the test cases requires that Unicode uppercase letters be handled.
I’ve Googled a little bit and couldn’t found anything useful. An answer on Stackoverflow suggested to use regular expression on the string. I wonder if there’s anything as simple as Unicode.is_upper? in the standard library.
Trending in Chat/Questions
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
egze
Maybe you can compare if your letter is equal to
String.upcaseof the same letter. If yes - then you have the uppercased lettersatoru
I also need to check if it’s a “letter” at all, if it’s not a letter then I don’t check if it’s upper case.
malaire
Perhaps check if
Unicode.category/1returns:Lu.EDIT: Just noticed that there is also
Unicode.uppercase?/1which does this exact check.LostKobrakai
I was about to suggest
ex_unicodeas well, but given the nature of this being an exercise I doubt they expect people to use an external dependency.egze
Just a hint, I don’t think you need to check every codepoint individually, but instead try to work with the whole string input and just the
Stringmodule.satoru
What should I import to use
Unicode?satoru
I have to check for 2 conditions:
malaire
Unicodeis fromex_unicodepackage.Alternatively if you want to stay with standard library, check out Regex character classes which include
alphaandupper.satoru
Thanks.
Dusty
When I first solved Bob, I did so entirely with the
Regexmodule. One of the comments my mentor made, was that, although Bob can be solved many ways, the intent of this exercise (on the Elixir track) is to get you familiar with theStringmodule. I was encouraged to return to theStringmodule, and solve the exercise without using any regexes at all. The solution I came up with turned out to be much more elegant than the regex solution, and indeed required only functions fromString.Here is a hint to get you started: Under what conditions would the uppercase version of a string be the same as the original? Are there other relationships like this you can leverage?