Reputation: 1203
Is there any way using MySQL statements to find the location where the 1st lowercase letter appears ? for example, I would like to get the number 7 (the location of the 1st lowercase letter "a") should I run the needed statements on the string
"MARY Had a little lamb"
Upvotes: 0
Views: 55
Reputation: 1269873
You can use regexp_instr()
(at least in MySQL 8+). However, you need a case sensitive collation:
select regexp_instr('MARY Had a little lamb' collate utf8mb4_bin, '[a-z]')
Upvotes: 2