【发布时间】:2014-02-19 10:12:52
【问题描述】:
我在使用响应创建动态<p> 元素时遇到以下问题!响应是纯文本。我需要确定字符串是否包含换行符或段落分隔符。
示例字符串
All rates are inclusive of the applicable Service charge, VAT, NBT & TDL currently at the prevailing 10%, 12%, 2% & 1% respectively. In the event of a change in the Service charge, VAT, NBT & TDL or the introduction of additional taxes, the Contract Rates will be adjusted accordingly.
All rates are inclusive of the applicable Service charge, VAT, NBT & TDL currently at the prevailing 10%, 12%, 2% & 1% respectively. In the event of a change in the Service charge, VAT, NBT & TDL or the introduction of additional taxes, the Contract Rates will be adjusted accordingly.
All rates are inclusive of the applicable Service charge, VAT, NBT & TDL currently at the prevailing 10%, 12%, 2% & 1% respectively. In the event of a change in the Service charge, VAT, NBT & TDL or the introduction of additional taxes, the Contract Rates will be adjusted accordingly.
这个字符串是三个段落组合在一起!如何识别每个单独的段落以使用 javascript 为每个段落创建单独的 <p> 标签。
【问题讨论】:
标签: javascript jquery string substring