开发者

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>&#09;</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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜