-1
When I use teste.length
it returns me the size, but how do I check if it contains no character?
For example:
var teste = (como se o usuário tivesse clicado **2x** no **enter/espaço**);
Soon teste.length
will return me 2, but in reality does not contain any character.
I wish that when I had nothing, I would return 0.
Your concept is wrong, if it contains no characters the size is 0. It has spaces so it has characters. If you don’t want to count certain types of characters you would have to define them very well. It is even possible for the user to paste something that has no visible characters and is not space. So what? for me or define the right problem and find a real solution or get gambiarra anyway.
– Maniero
I think the colleague just expressed himself badly, he meant that for his motivation, blank space would not be a valid character. But you’re right, space is a valid character.
– Jaffe.Marques
@David just needs to express exactly to have an exact result. As a rule of thumb, there is ambiguity until we talk about space. In general people don’t understand what they don’t see, and non-printable characters are valid and not usually interesting, not just space. Anyway do there a say fault and the person does not know why. Conceptualize everything right is important to do right.
– Maniero