java - 在 JAVA 中换行

标签 java youtube-api

如果我做对了或者我遗漏了什么,我就不会。当我执行以下操作以在我的 YouTube 描述中创建一个新行时,它们出现不正确。

private static final String newLine = System.getProperty("line.separator");
mg.setDescription(new MediaDescription());
mg.getDescription().setHtmlContent("This is line one." + newLine + "This is line two." + newLine + newLine + "This is line three.");

YouTube 描述中的内容是这样的

This is line one.
This is line two. This is
line three.

什么时候应该这样出来。

This is line one.
This is line two.

This is line three.

我觉得我没有在这里做某事;如果我没有得到正确的布局作为我的最终结果。

最佳答案

添加换行符实际上不会在 HTML 中创建换行符。您需要使用 <br />标签。

关于java - 在 JAVA 中换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11724482/

相关文章:

java - Joda:将系统日期和时间转换为另一个区域中的日期/时间

java - 可通过 while 循环调用

javascript - 暂停视频后触发点击文件上传

youtube - 如何使用API​​代替Google BigQuery数据传输服务?

java - 在Java中多次从标准输入读取

java - 这是Java中 'Phantom Types'的准确转换吗?

iphone - 使用 AVFoundation 在自定义播放器中播放 youtube 视频

javascript - YouTube Iframe API 初始化后,player.getPlayerState 不可用

php - 使用 API 3.0 在 Android 中获取带有视频 ID 的 YouTube 标题

java - 从 Elasticseatch 2.x 升级到 5.x