cancel
Showing results for 
Search instead for 
Did you mean: 

Text content

heyo
Senior

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

1 ACCEPTED SOLUTION

Accepted Solutions
Osman SOYKURT
ST Employee

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

Osman SOYKURT
ST Software Developer | TouchGFX

View solution in original post

1 REPLY 1
Osman SOYKURT
ST Employee

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

Osman SOYKURT
ST Software Developer | TouchGFX