本文介绍了你如何在角色之前删除斜线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的filder路径

~ / UserSideSaurashtr_Dyanamic / home_slider /青年节/

我想要

home_slider /青年节/



如何在sql中实现

.................... ................................................


我尝试了什么:



i有这样的filder路径

~ / UserSideSaurashtr_Dyanamic / home_slider / Youth Festival /

我想要
home_slider / Youth Festival /

i have filder path like this
~/UserSideSaurashtr_Dyanamic/home_slider/Youth Festival/
and i want to
home_slider/Youth Festival/

how to possible in sql
....................................................................

What I have tried:

i have filder path like this
~/UserSideSaurashtr_Dyanamic/home_slider/Youth Festival/
and i want to
home_slider/Youth Festival/

推荐答案

declare @x nvarchar(125) = '~/UserSideSaurashtr_Dyanamic/home_slider/Youth Festival/'
select REPLACE(@X, '~/UserSideSaurashtr_Dyanamic/','')



但我怀疑到目前为止还有更多这方面的内容





显然'〜/ UserSideSaurashtr_Dyanamic /'位是动态的但是'home_slider /你节日/'是固定的,所以试试这个


But I suspect there is more to this than you have shown so far


Apparently the '~/UserSideSaurashtr_Dyanamic/' bit is dynamic but the 'home_slider/Youth Festival/' is fixed, so try this

SELECT SUBSTRING(@x, CHARINDEX('home_slider', @x), LEN(@x))


这篇关于你如何在角色之前删除斜线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 02:00