i have a template ` aligned With Code...
# announcements
c
i have a template
Copy code
aligned With Code"""
................ class Dance{
...................companion SType{
.........................dress = "BW"
.......................}
.................}
                 """
how to trim this (the dots are spaces which need to trimmed) ,so after format those spaces gets trimmed
c
i dont want to trim the Indent , no no
Indent is important for ktlint
c
What are you looking to trim from it, then?
I don’t think there are any stdlib functions to fully trim each individual line, but it’s easy enough to do it yourself. Just split into lines, map lines to trim each, and then join back together. Probably not the most efficient, but it works https://pl.kotl.in/RqdIk_CSr
c
Oh! i forgot it must not fully trim space inside the class , guess need to do it myself.
small parser 😛 , reformat and publish
instead replace required spaces with placeholder to get replaced?
s
@Casey Brooks just in case you didn’t know, you can actually pass a lambda to
joinToString
to provide some pre-joining logic for each string in the collection, no
.map {}
required
c
Ah, right, I always forget about that!
😄 1
1