Replace [^a-zA-Z0-9] with an empty string. string str = “This-is-my+++***RegexPattern&Text”; Regex rgx = new Regex(“[^a-zA-Z0-9]”); str = rgx.Replace(str, “”); OUTPUT: ThisismyRegexPatternText If you want to add an exception then you should add this character like this to the regex pattern (let’s assume you wish to exclude the ampersand): [^a-zA-Z0-9 &] string str = “This-is-my+++***RegexPattern&Text”; Regex rgx = […]
Tag: all
How to disable mouse actions for a specific div with CSS
Let’s say you have a div with id “myDiv” <div id=”myDiv”> <input type=”text” value=”value” /> <br /> <textarea>value</textarea> </div> If you want to disable all the mouse actions in that div only then you can use this in your CSS file: #myDiv { pointer-events: none; }
How replace characters with asterisks (*) except first characters
const theName = “Vincent van Gogh”; function hideWord(word) { if (word.length < 2) return word; return word.substring(0, 1) + ‘*’.repeat(word.length-1); } console.log(theName.split(” “).map(hideWord).join(” “)); OUTPUT: V****** v** G*** You could also wrap the whole lot in a function if you wanted to be able to call it from multiple places and avoid redefining it. function […]
How to wrap very long text in Asp.Net Razor
That will save you: <div style=”word-break: break-all;”> THEVERYVERYLOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONGTEXT </div>
How To Get All Row Count For All Tables In SQL Server Database
SELECT (SCHEMA_NAME(A.schema_id) + ‘.’ + A.Name) AS TableName , SUM(B.rows) AS RecordCount FROM sys.objects A INNER JOIN sys.partitions B ON A.object_id = B.object_id WHERE A.type = ‘U’ GROUP BY A.schema_id, A.Name ORDER BY RecordCount DESC
Search text in all tables in SQL Server
Please note that with a little bit changing you can also use this query as a stored procedure.
Drop all the tables, stored procedures, triggers, constraints and all the dependencies in one sql statement
These 2 scripts clean all views, SPS, functions PKs, FKs and tables. 1. The First script by Adam Anderson, updated to support objects in other schemas than dbo: — check constraints select @stmt = isnull( @stmt + @n, ” ) + ‘alter table [‘ + schema_name(schema_id) + ‘].[‘ + object_name( parent_object_id ) + ‘] drop […]