Re: [Vala] How to check if string is empty
- From: Ulink <ulink gmx at>
- To: vala-list gnome org
- Subject: Re: [Vala] How to check if string is empty
- Date: Tue, 17 Jan 2017 10:24:55 +0100
As Guillaume wrote, you have to use string? str and check string==null
FIRST.
But I think str.length==0 and str=="" are no high performance solutions,
especially for big/long strings.
Maybe this is better?
bool is_null_or_empty (string? str)
{
return str == null || str[0] == '\0';
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]