Jump to content

Empty string: Difference between revisions

added ocaml
m (I don't know Tcl but I guess this is a typo)
(added ocaml)
Line 95:
System.out.println("s is not empty");
}</lang>
 
=={{header|OCaml}}==
 
<lang ocaml>let is_string_empty s =
(s = "")
 
let () =
let s1 = ""
and s2 = "not empty" in
Printf.printf "s1 empty? %b\n" (is_string_empty s1);
Printf.printf "s2 empty? %b\n" (is_string_empty s2);
;;</lang>
 
outputs:
<pre>
s1 empty? true
s2 empty? false
</pre>
 
=={{header|Perl}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.