declare @string varchar(2000) declare @newstring varchar(2000) declare @num int declare @code int select @string = '!@#,$%^,&*(,)' select @newstring = '' select @num = 1 while @num < len(@string)+1 begin set @code = Ascii(SubString(@String, @Num, 1)) --- ascii: 48-57 (numbers 0-9) --- ascii: 65-90 (uppercase letters A-Z) --- ascii: 97-122 (lowercase letters a-z) If (@code between 48 and 57) or (@code between 65 and 90) or (@code between 97 and 122) begin set @newstring = @newstring + Substring(@string, @num, 1) end set @num = @num + 1 end select @newstring
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.