在SQL中,我想修剪字符串 [英] In sql i want to trim the string

查看:75
本文介绍了在SQL中,我想修剪字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想得到如下字符串

在我的数据库中,名称=软件开发"
我想获得Name = SoftwareDevelopment''

就像我想要没有空间的字符串如何在SQL中执行该操作以及如何在vb.net中解决相同的问题一样
请帮助

I want to get the string like following

In my database the Name=''Software Development''
I want to get the Name=SoftwareDevelopment''

Just like i want the string without space how to do it in SQL and same problem how to solved in vb.net
Please help

推荐答案

除了Mojurul的解决方案之外,这里还包括它的实现:
In addition to Mojurul''s solution here is its implementation :
declare @s varchar(max)
set @s='Name=''Software Development'''
set @s = replace(@s, '''', '')
set @s = replace(@s, ' ', '')
print @s


尝试这个

hi try this

declare @s varchar(100)
 set @s='Software Development'

declare @s2 varchar(100)
 set @s2= REPLACE(@s, ' ','');
print @s2


尝试以下操作:
C#替换字符串示例
替换(Transact-SQL)
Try following:
C# Replace String Examples
REPLACE (Transact-SQL)


这篇关于在SQL中,我想修剪字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆