|
62 | 62 | (defn CODE*
|
63 | 63 | "Returns the numeric Unicode map value of the first character in the string provided."
|
64 | 64 | [text]
|
65 |
| - (let [text (coerce/excel-str text) |
| 65 | + (let [text (coerce/excel-string text) |
66 | 66 | res #?(:clj (some-> text first int)
|
67 | 67 | :cljs (.charCodeAt text 0))]
|
68 | 68 | #?(:clj res
|
|
102 | 102 | (defn EXACT*
|
103 | 103 | "Tests whether two strings are identical."
|
104 | 104 | [str1 str2]
|
105 |
| - (= (coerce/excel-str str1) |
106 |
| - (coerce/excel-str str2))) |
| 105 | + (= (coerce/excel-string str1) |
| 106 | + (coerce/excel-string str2))) |
107 | 107 |
|
108 | 108 | (def EXACT #'EXACT*)
|
109 | 109 |
|
|
141 | 141 | (let [text (cond
|
142 | 142 | (string? text) text
|
143 | 143 | (seqable? text) (first text))]
|
144 |
| - (count (coerce/excel-str text)))) |
| 144 | + (count (coerce/excel-string text)))) |
145 | 145 |
|
146 | 146 | (def LEN #'LEN*)
|
147 | 147 |
|
148 | 148 | (defn LOWER*
|
149 | 149 | "Converts a specified string to lowercase."
|
150 | 150 | [text]
|
151 |
| - (string/lower-case (coerce/excel-str text))) |
| 151 | + (string/lower-case (coerce/excel-string text))) |
152 | 152 |
|
153 | 153 | (def LOWER #'LOWER*)
|
154 | 154 |
|
|
157 | 157 | [text start number]
|
158 | 158 | (let [start (coerce/excel-number start)
|
159 | 159 | number (coerce/excel-number number)
|
160 |
| - text (coerce/excel-str text) |
| 160 | + text (coerce/excel-string text) |
161 | 161 | text-end (count text)
|
162 | 162 | params-start (dec start)
|
163 | 163 | params-end (+ (dec start) number)
|
|
174 | 174 | (defn PROPER*
|
175 | 175 | "Capitalizes each word in a specified string."
|
176 | 176 | [text]
|
177 |
| - (string/replace (coerce/excel-str text) #"\w*" string/capitalize)) |
| 177 | + (string/replace (coerce/excel-string text) #"\w*" string/capitalize)) |
178 | 178 |
|
179 | 179 | (def PROPER #'PROPER*)
|
180 | 180 |
|
|
210 | 210 | (let [position (coerce/excel-number position)
|
211 | 211 | length (coerce/excel-number length)]
|
212 | 212 | (str (subs text 0 (dec position))
|
213 |
| - (coerce/excel-str new-text) |
| 213 | + (coerce/excel-string new-text) |
214 | 214 | (subs text (+ (dec position) length)))))
|
215 | 215 |
|
216 | 216 | (def REPLACE #'REPLACE*)
|
|
267 | 267 | remove-empty-text)
|
268 | 268 | not-empty
|
269 | 269 | identity)
|
270 |
| - (string/split (coerce/excel-str text) |
| 270 | + (string/split (coerce/excel-string text) |
271 | 271 | (re-pattern (if split-by-each
|
272 | 272 | (string/join "|" (map regex-escape
|
273 |
| - (vec (coerce/excel-str delimeter)))) |
274 |
| - (regex-escape (coerce/excel-str delimeter)))) |
| 273 | + (vec (coerce/excel-string delimeter)))) |
| 274 | + (regex-escape (coerce/excel-string delimeter)))) |
275 | 275 | -1)))
|
276 | 276 |
|
277 | 277 | (def SPLIT #'SPLIT*)
|
|
298 | 298 | (let [occurrence (cond
|
299 | 299 | (nil? occurrence) :all
|
300 | 300 | :else (coerce/excel-number occurrence))]
|
301 |
| - (substitute-fn* (coerce/excel-str text) |
302 |
| - (coerce/excel-str old-text) |
303 |
| - (coerce/excel-str new-text) |
| 301 | + (substitute-fn* (coerce/excel-string text) |
| 302 | + (coerce/excel-string old-text) |
| 303 | + (coerce/excel-string new-text) |
304 | 304 | occurrence)))
|
305 | 305 |
|
306 | 306 | (def SUBSTITUTE #'SUBSTITUTE*)
|
|
320 | 320 | "Removes leading, trailing, and repeated spaces in text."
|
321 | 321 | [& args]
|
322 | 322 | (string/trim
|
323 |
| - (string/replace (-> args first coerce/excel-str) #"\ +" " "))) |
| 323 | + (string/replace (-> args first coerce/excel-string) #"\ +" " "))) |
324 | 324 |
|
325 | 325 | (def TRIM #'TRIM*)
|
326 | 326 |
|
|
329 | 329 | [& args]
|
330 | 330 | (-> args
|
331 | 331 | first
|
332 |
| - coerce/excel-str |
| 332 | + coerce/excel-string |
333 | 333 | string/upper-case))
|
334 | 334 |
|
335 | 335 | (def UPPER #'UPPER*)
|
|
353 | 353 | (let [items (flatten items)
|
354 | 354 | items (if ignore-empty (keep identity items) items)]
|
355 | 355 | (->> items
|
356 |
| - (map coerce/excel-str) |
| 356 | + (map coerce/excel-string) |
357 | 357 | (string/join delimeter))))
|
358 | 358 |
|
359 | 359 | (def TEXTJOIN #'TEXTJOIN*)
|
|
0 commit comments