Is the string non-empty but only made of whitespaces?

assert " \n\t ".is_whitespace    == true
assert "  hello  ".is_whitespace == false
assert "".is_whitespace          == false

Char::is_whitespace determines what is a whitespace.

Property definitions

core $ Text :: is_whitespace
	# Is the string non-empty but only made of whitespaces?
	#
	# ~~~
	# assert " \n\t ".is_whitespace    == true
	# assert "  hello  ".is_whitespace == false
	# assert "".is_whitespace          == false
	# ~~~
	#
	# `Char::is_whitespace` determines what is a whitespace.
	fun is_whitespace: Bool
	do
		if is_empty then return false
		for c in self.chars do
			if not c.is_whitespace then return false
		end
		return true
	end
lib/core/text/abstract_text.nit:505,2--521,4