I would like to use the names correctly, which in this case mean:
- The first letter is uppercase.
- The first letter after a space is capitalized (Van Helsing, not Van Helsing)
- The first letter after the dash is uppercase (“Johnson Smith,” not “Johnson Smith”)
- No other letters are capitalized.
The first and last requirements are easily processed:
CONCAT(LEFT(name, 1), LOWER(RIGHT(name, LENGTH(name) - 1)))
Others are harder. I wrote a 54x REPLACE nested expression (not manually, I used Excel)
REPLACE(REPLACE(REPLACE(REPLACE(...,' b',' B'),'-b','-B'),' a',' A'),'-a','-A')
but I feel that there should be a more elegant and maintainable solution. Any ideas?
If there is a built-in function similar, but not identical to my requirements, which is likely to be fine.
: script , , . , , , . , (~ 30%) [-].