All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lightningkite.lightningserver.email.EmailLabeledValue.kt Maven / Gradle / Ivy

The newest version!
package com.lightningkite.lightningserver.email

import kotlinx.serialization.Serializable

@Serializable
data class EmailLabeledValue(
    val value: String,
    val label: String = ""
) {
    companion object {
        fun parse(raw: String) =
            EmailLabeledValue(label = raw.substringBefore('<', "").trim(), value = raw.substringAfter('<').substringBefore('>').trim())
    }

    override fun toString(): String = "$label <$value>"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy