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: empty
How to solve extra blank page at end of Microsoft Reportviewer
To solve that problem you need to set the property ConsumeContainerWhitespace to True (in the properties dialog, F4).
Hide element in CSS with Display and Visibility
visibility: hidden (Hide but keep the space) <div stlye=”visibility: hidden;”>The Components We want to Hide</div> By default, the value of the visibility property is visible. However, if you want to make an image invisible, you can set the value of visibility to hidden. display: none (Hide and remove the space) <div stlye=”display: none;”>The Components We want to Hide</div> The display […]
How to check for ‘IS NOT NULL’ And ‘IS NOT EMPTY’ string in SQL
If you only want to match N” as an empty string SELECT COLUMN FROM TABLE WHERE DATALENGTH(COLUMN) > 0 If you want to count any string consisting entirely of spaces as empty SELECT COLUMN FROM TABLE WHERE COLUMN <> ” If you want to use DATALENGTH for any string consisting entirely of spaces then you […]
How to fix blank thumbnails in the WordPress Media Library
Mostly that problem is about the persmission for uploads folder of your wordpress website. So first, please check the permissions for your uploads folder. Start by navigating in your WordPress dashboard to Settings -> Media. Make sure that the option Organize my uploads into month- and year-based folders is checked. Next go into your Cpanel for your domain, […]
Add blank item at top of dropdownlist
drpList.Items.Insert(0, new ListItem(String.Empty, String.Empty)); drpList.SelectedIndex = 0;