Link to home
Start Free TrialLog in
Avatar of rye004
rye004Flag for United States of America

asked on

Black box character in HTML?

I have built a tool that redacts text based on patterns.  I use this to remove sensitive information like social security numbers, credit cards, etc.  I am currently using this for HTML files.

Typically I just replace the text with the “X” character.  Instead of a “X” I am looking to use some type of Square character (I am thinking of just a black box).  I am not able to figure out how to do this for HTML files.

currentRegularExpressionsToSearch.redactionAsciCode = 88; //This is the asci code for an “X”, I want to do a square instead.

//This statement does the replace.
currentFileText = Regex.Replace(currentFileText, redactString, new String((char)currentRegularExpressionsToSearch.redactionAsciCode, redactString.Length));

Open in new window


Does anyone know if this is possible?  Hopefully what I am looking to do makes sense.
Avatar of Arun Murugan
Arun Murugan

Use ASCII code 254.
Avatar of rye004

ASKER

Thank you Arun for your email.  I did try 254 before doing this posting.  This is what it looks like in a HTML file in Firefox.  I have attached a screenshot of what 254 looks like.
temp.jpg
Avatar of crystal (strive4peace) - Microsoft MVP, Access
how about ■ ■
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
found another html code for it:

▪
Just to be alternative.
CSS
.squares i {
  display: inline-block;
  background: url(images/dots.gif) no-repeat center center;
  width: 8px;
  height: 8px;
}

Open in new window

HTML
<span class="squares"><i></i><i></i><i></i><i></i></span>

Open in new window

ImageUser generated imageWorking sample here
Avatar of rye004

ASKER

This worked great, thank you.

Thank you for taking the time to write out the HTML.
You're welcome, glad to help.