首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >换行,KDoc中的新行

换行,KDoc中的新行
EN

Stack Overflow用户
提问于 2018-03-29 14:38:15
回答 2查看 6.9K关注 0票数 27

假设我们有这样有记录的字符串

代码语言:javascript
复制
/** retrieve a state of the service
* <br/> HTTP code 200 - normal state
* <br/> HTTP code 403 - some recoverable state:
const val SERVICE_STATE = "servicestate" */

这里有几个<br/>,我用它打破一行,就像我在java中所做的那样,但是AndroidStudio的输出(在InteliJIdea中似乎是一样的)是

使用java可以正确地解析和显示:

代码语言:javascript
复制
/** retrieve a state of the service
 * <br/> HTTP code 200 - normal state
 * <br/> HTTP code 403 - some recoverable state */
public static final String SERVICE_STATE = "servicestate";

我可以用kotlin & IntelijIdea实现同样的目标吗?也许kotlin还有另一个选择来打破KDoc的界限?

EN

回答 2

Stack Overflow用户

发布于 2021-12-05 13:34:40

要添加到@hotkey的回答中,还可以使用三重回退,因为支持Markdown:

代码语言:javascript
复制
/**
 * Returns masked complement, i.e. expected value in the [maskBits] bits instead of a negative number because of
 * 2's complement representation
 *
 * For example, for 9:
 * ```
 *  Binary representation:         00...01001
 *  Complement:                    11...10110 which is -10
 *  Masking with 4 bits:  and with 00...01111
 *  So we get:                     00...00110 which is the expected bitwise complement
 * ```
 * @param maskBits Number of bits to mask the complement to
 * @return Decimal representation of the masked complement
 */
fun Int.inv(maskBits: Int) = inv() and 2.pow(maskBits) - 1

结果是:

票数 7
EN

Stack Overflow用户

发布于 2022-10-03 08:48:27

可以在列表中使用破折号。在这种情况下不需要空行。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49558881

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档