Declare @spnames CURSOR Declare @spname nvarchar(max) Declare @moddef nvarchar(max) Set @spnames = CURSOR FOR select distinct object_name(c.id) from syscomments c, sysobjects o where c.text like ‘%findtext%’ and c.id = o.id and o.type = ‘P’ OPEN @spnames FETCH NEXT FROM @spnames into @spname WHILE @@FETCH_STATUS = 0 BEGIN Set @moddef = (SELECT Replace ((REPLACE(definition,’findtext’,’replacetext’)),’ALTER’,’create’) FROM sys.sql_modules […]
Tag: replace
How to trim whitespaces between characters in C#
trim() function does NOT remove “all whitespace characters” of your string. So instead of trim(), you can use String.Replace method: string str = “C Sharp”; str = str.Replace(” “, “”); OUTPUT: CSharp or if you want to remove all whitespace characters (space, tabs, line breaks…) string str = “C Sharp”; str = Regex.Replace(str, @”\s”, “”); […]