prefix

Kotlin: Convert a list to a String (joinToString syntax/example)

Here’s a little Kotlin joinToString example. First, a sample list to work with:

val nums = listOf(1,2,3,4,5)

Then here’s the joinToString example:

nums.joinToString(
    separator = ", ",
    prefix = "[",
    postfix = "]",
    limit = 3,
    truncated = "there’s more ..."
)

When you put all of that code in the Kotlin REPL you’ll see this result:

A Drupal form custom HTML DIV CSS wrapper example

Drupal form custom HTML FAQ: How can I wrap some custom HTML around a Drupal form, like placing a wrapper DIV tag around my form so I can add some custom CSS to style my form/div?

You can wrap an HTML DIV tag around your Drupal form by using the form prefix and suffix properties, like this: