Browsing articles tagged with " Special Characters"

SQL Server | Remove Special Characters

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

I needed to remove all the special characters from a field in a particular table in SQL Server to be used for searching purposes. After searching (binging :P )… I found the next SQL Server Function which did the trick.

This Function Removes any special character from the string value passed. All characters except 0-9, a-z and A-Z are all removed, whilst the remaining characters are returned back.

ALTER FUNCTION dbo.RemoveSpecialCharacters
(
@s VARCHAR(256)
)
RETURNS VARCHAR(256) WITH SCHEMABINDING

BEGIN
IF (@s is null)
RETURN null Continue reading »

Remove Special Characters (like !, %, &, #) from String | Javascript

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

No, this post is not about dieting or anything like that… but to remove Special Kharacters. To do this, I was going to use a for loop in javascript that checks each character and if it is not between ‘A’ and ‘Z’, the character will be removed. Until I found this code lying around on the net which makes removing special characters very simple…

function removeSpecialChars(strVal)
{
strVal = strVal.replace(/[^a-zA-Z 0-9]+/g,”);
}