Logo

Programming-Idioms

History of Idiom 169 > diff from v111 to v112

Edit summary for version 112 by programming-idioms.org:
[Clojure] Added Demo URL

Version 111

2022-08-18, 22:39:31

Version 112

2022-08-18, 22:40:00

Idiom #169 String length

Assign to the integer n the number of characters of the string s.
Make sure that multibyte characters are properly handled.
n can be different from the number of bytes of s.

Idiom #169 String length

Assign to the integer n the number of characters of the string s.
Make sure that multibyte characters are properly handled.
n can be different from the number of bytes of s.

Variables
n,s
Variables
n,s
Extra Keywords
size characters chars number runes
Extra Keywords
size characters chars number runes
Code
(defn n[s] (.codePointCount s 0 (count s)))
Code
(defn n[s] (.codePointCount s 0 (count s)))
Comments bubble
Here n is a function
Demo URL
https://replit.com/@ProgIdioms/AdmirableFinancialDemo#main.clj