Why should anyone make this kind of functions?
There's only one reason #clopher #clojure

I'm going mad.

Follow

@ekaitz_zarraga

Hey, you can use `subs` and `format` for this kind of jobs:

```
(defn abbr [string max-size cursor-col]
(->> (subs string cursor-col)
(format (str "%." max-size "s"))))

(defn fill-right [string size]
(->> string
(format (str "%-" size "s"))))

(defn fill-left [string size]
(->> string
(format (str "%" size "s"))))
```

@mdallastella I'm not versed in format so I avoid it.

Thank you for the info. I'll educate myself more and then start using it :)

I'll need it for this thingie

Sign in to participate in the conversation
Functional Café

functional.cafe is an instance for people interested in functional programming and languages.