Horizontal Tab in Unicode
I have a function which stores a string that has read off a StreamReader. The file in questio开发者_StackOverflown contains horizontal tabs, which I know are registered as U+0009 in Unicode. I'd like to display the string in HTML, which involves some conversion obviously.
The code I've used to attempt this conversion is
readResults = readResults.Replace(ChrW(&H9), "	")
Unfortunately, no love. The tab is removed as is expected of any whitespace characters left undealt with. Any ideas?
EDIT: Figured it out
readResults = readResults.Replace(vbTab, "<pre>	</pre>")
Add the white-space:pre-wrap
CSS property to your HTML element. This property will force all white-space (including tabs) to appear. When you also want to preserve newlines, use white-space:pre
.
精彩评论