End marker in quotes inside block comment

Viewed 121

I am trying to add a block comment where the start marker (/*) appears inside quotes:

/*
const val MIME_TYPE = "image/*"
*/

This is possible in Java, but fails in Kotlin. The same problem arises with the end marker inside the quotes. Is this a known compiler bug/limitation? Is there any alternative syntax (besides line comments) that allow me to maintain the string definition inside a block comment?

1 Answers

Try this

/**
const val MIME_TYPE = "image\/*"
*/

EDIT:

You have to use the escape character \ because / is special character.

Related