Skip to content

Instantly share code, notes, and snippets.

View captswag's full-sized avatar
👘
3 time employee of the month

Anjith Sasindran captswag

👘
3 time employee of the month
View GitHub Profile
@captswag
captswag / Truss.java
Last active April 30, 2021 16:13 — forked from JakeWharton/Truss.java
Rewrote Jake Wharton's wrapper of SpannableStringBuilder in Kotlin
import android.text.SpannableStringBuilder
import android.text.Spanned.SPAN_INCLUSIVE_EXCLUSIVE
import java.util.ArrayDeque
import java.util.Deque
// https://gist.github.com/JakeWharton/11274467
public class Truss {
private val builder: SpannableStringBuilder = SpannableStringBuilder()
private val stack: Deque<Span> = ArrayDeque()