允许单词之间有空格 [英] Allow White Spaces between Words

查看:105
本文介绍了允许单词之间有空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用asp.net 1.x,在这里我必须将值与空格一起存储在数据库中
例如:我的新主题"
在这里,我给了这些单词之间的空格(无法在预览中看到,因为每个单词之间仅占用一个间距),但是当我保存它们或尝试将它们显示在Label或网格中时,它们之间的空格会减少,每个单词之间只有一个空格如何解决?
另一个问题是,是否可能在单词的末尾留有空格,例如:线程"(无法在预览中看到,因为每个单词之间仅占用一个间距),如果可以,则显示为在此示例中,我通过databinder.Eval(Container.DataItem,"firstName")在网格中给出了
即:
<asp:Label id="label1" runat="server" Text=''<%# DataBinder.Eval(Container.DataItem, "firstName") %></asp:Label>
因为eval会修剪空白!!
问候
Raghul

Hi,
I am using asp.net 1.x, Here i will have to store the values in the database along with the white spaces
for eg: "My New Thread"
here I have given spaces between these words (could not be seen in the preview as it takes only one spacing between each word) but when i save them or try to display them in a Label or in a grid the spaces between them are reduced and only one space is shown between each words how to solve this?
Another question is, is that possible to have blank spaces at the end of a word for eg: "Threading " (could not be seen in the preview as it takes only one spacing between each word), if so is it possible to show as I have given in this example in the grid by databinder.Eval(Container.DataItem, "firstName")
ie:
<asp:Label id="label1" runat="server" Text=''<%# DataBinder.Eval(Container.DataItem, "firstName") %></asp:Label>
because eval trims the blank spaces!!
Regards
Raghul

推荐答案

您的HTML文件仅显示一个空格,而不管您放了多少空格.如果要显示多个空格,则需要使用HTML通过& nbsp;
The issue you Html only displays one space, no matter how many you put in. If you want to display more than one space, you need to use a none-breaking space which, cunningly enough, HTML provides through the medium of &nbsp;


这篇关于允许单词之间有空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆