How do you detect space in text string?

One way is to split it put to a list and then check the length of original string


Instead if this round about method can't we just do like this?

Please advice Thanks

image

1 Like

Thanks a bunch TIMAI2 got it. The word piece is misleading. Instead of piece if it had been Text or String then I would have guessed its use. I just discovered an if() does not take "split at space", so it does not return a logical value. If MIT app had made "split at space" to return true or false then it would have been much elegant right? Just a thought. Thanks again

Btw, to count all spaces:

2 Likes

This could be smwhat more reduced form

1 Like

Of course, I thought it might not work for (very) long texts without using a "while" test.

Text of what length? Are you concerned about accuracy or timeliness. Maybe it could take smwhat long time to process, but I think that shuld be same for looping as well, might be I am not very correct.

But as far as the string is concerned there should be a constraints regarding what length that could possess language to language.

1 Like

How long does it take to get the result? Sec?

2 seconds approx.

Ok, I didn't expect it to work without the while loop then.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.