在每行文字中添加字符? [英] Add character to every line of text?

查看:79
本文介绍了在每行文字中添加字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个函数,它从数据库中获取一段文本并将其放入textarea中,我试图在数据库中取出的非常行的文本旁边放置一个像''>'这样的符号。放入textarea来显示它从数据库中获取,任何人都可以帮忙吗?

I have a function that takes a piece of text from the database and puts it into a textarea, I''m trying to put a symbol like ''>'' beside very line of text thats taken from the database and put into the textarea to show its taken from the database, can anyone help?

推荐答案

如果你已经定义了行数,那么你可以在每个行之前添加(行) ?2)字符你的指标> "。
if you have defined the number of rows, then you can add before every (rows ? 2) characters your indicator "> ".


问题是,它是一个textarea,当第一行填充时,它会转到下一行,所以我不知道它何时会进入下一行! ?
The problem is, its a textarea and when the first line is populated it goes to the next line so i don''t know when it will go to the next line!?


您好。


首先,您不能放置符号>进入HTML输出而不会导致各种问题。这是一个保留字符。

使用HTML符号& gt;代替。 (没有引号。)


我不太明白你想要在这里完成什么。

你想要把> "在你的文本框里面的每一行之前?

如果是这样,请尝试在每个换行符之后添加HTML符号。
(替换所有出现的内容) \ n和\ n& gt;应该这样做。再次,没有引号)


如果没有,请详细说明。

请记住,我们喜欢代码示例和错误消息;]
Hi.

First of all, you can not put the symbol ">" into your HTML output without causing all sorts of problems. It is a reserved character.
Use the HTML symbol ">" instead. (Without the quotes.)

I''m not quite getting what you are trying to accomplish here.
Do you want to put ">" before every line of text inside your textbox?
If so, try adding the HTML symbol after each new-line character.
(Replacing all occurences of "\n" with "\n>" should do that. Again, without the quotes)

If not, please elaborate.
Remember, we like code examples and error messages ;]


这篇关于在每行文字中添加字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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