http://ai2.appinventor.mit.edu/reference/blocks/text.html#length

Returns the number of characters including spaces in the string. This is the length of the given text string.

the returns the number of characters including spaces in the string block needs to connect where can more details?

number = length TextBox1.Text

Thank you for teaching me how to calculate the number of characters but the space in the text still counted

Where there is to be a space, do not enter the word "space" just make spaces. And where the "empty string" is, do not enter anything.

I try it already before but still not work

The @Patryk_F 's solution is correct.

But, this is another way to solve your problem.

These block can calculate string with *space* without counting the *space*

and then you can proceed with counting even or odd.

If this for your school assignment, then you should try to understand this block first, and then try to implement it by your own.

Not just copying it, so at least you will learnt something.

Thanks for another way to solve my problem. Your way I don't really understand some block mean because I am still new to this app inventor.

You have entered spaces in both fields, or you have both fields empty. The "segment" field should have one space, the "replacement" field should not have spaces, must be empty. Do it right and it will work.

This block is used to convert spaces into an empty string. Then in the text you will eliminate the spaces and the length block will count only the letters.