假设我们有这样有记录的字符串
/** 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可以正确地解析和显示:
/** 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的界限?
发布于 2021-12-05 13:34:40
要添加到@hotkey的回答中,还可以使用三重回退,因为支持Markdown:
/**
* 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结果是:

发布于 2022-10-03 08:48:27
可以在列表中使用破折号。在这种情况下不需要空行。

https://stackoverflow.com/questions/49558881
复制相似问题