In
this article I am going to explain how to remove the special characters like coma
(,), hyphen (-), underscore (_) from string using Sql server.
In
the previous article I have explained how to create tags using Jquery inasp.net, how to set color for ODD and EVEN rows in HTML Table using CSS,
Sort andfilter Grid using AngularJs in MVC and Form validation example using AngularJswith Bootstrap in MVC application.
Implementation:
To
remove the special characters from string I am using the REPLACE function of
sql server.
I
have created a table and insert some dummy record into it.
I
want to remove the.,_,- from student name and username. Here is the SQL query to get student and username without
special characters.
SELECT REPLACE(replace(StName,'.',' '),'_',' ') AS [Student Name],
replace(replace(replace(StUsername,'_',' '),'-',' '),'.',' ') as [username]
FROM Tb_Student
OUTPUT:
No comments:
Post a Comment