我的字符串如下,我需要驼峰式大小写的输出,如下
For example:
compact-cameras>ixus>digital-ixus-160
compact-cameras>ixus>digital-ixus-160>DSLR
scanners>document-scanners>dr-6030c
Output:
Compact cameras>ixus
Compact Cameras>Ixus>Digital Ixus 160
Scanners>Document Scanner
最佳答案
您可以通过下面的语句删除字符串的最后一部分并删除“-”,然后使用提供的链接-- camel case function 中的驼峰式大小写函数。
SELECT REPLACE(REPLACE('compact-cameras>ixus>digital-ixus-160>DSLR',SUBSTRING_INDEX('compact-cameras>ixus>digital-ixus-160>DSLR','>',-1),''),'-',' ');
Is there a simple way to convert MySQL data into Title Case?
关于mysql - SQL : I need to explode a string by ">" and want to remove the last thread and Replace the (-) by space in CamelCase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30889408/