Skip to main content
heyo
Associate III
January 12, 2023
Solved

Text content

  • January 12, 2023
  • 1 reply
  • 937 views

Hello, I want to compare text area content with enum TEXTS. How can I do this?

This topic has been closed for replies.
Best answer by Osman SOYKURT

Hello heyo,

I think you'll need to use the getText() function and the Unicode::strncmp() function :

int result = Unicode::strncmp(textArea1.getTypedText().getText(), TypedText(T_TEXT1).getText(), Unicode::strlen(textArea1.getTypedText().getText()));
 
touchgfx_printf("result : %d", result);
 
//result return 0 if they're identical, 1 if the strings are differents

/Osman

1 reply

Osman SOYKURT
Osman SOYKURTBest answer
ST Technical Moderator
January 16, 2023

Hello heyo,

I think you'll need to use the getText() function and the Unicode::strncmp() function :

int result = Unicode::strncmp(textArea1.getTypedText().getText(), TypedText(T_TEXT1).getText(), Unicode::strlen(textArea1.getTypedText().getText()));
 
touchgfx_printf("result : %d", result);
 
//result return 0 if they're identical, 1 if the strings are differents

/Osman

ST Software Developer | TouchGFX