Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
Hi everybody,
I have a curiosity about the string comparison. I'm using the = operator to compare strings in one of my function block. The question is: How much the performances change compare to a comparison of an integer?
Thank you very much.
Best regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just one more thing, do you strictly recommend to reduce the use of string comparison or because nowadays the cpu are very powerful so the time for string comparison is also negligible?
Thank you.
Best regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everybody,
I have a curiosity about the string comparison. I'm using the = operator to compare strings in one of my function block. The question is: How much the performances change compare to a comparison of an integer?
Thank you very much.
Best regards
Hello,
you should use functions provided in StringUtils to compare strings.
See e.g. https://help.codesys.com/webapp/j_Vv9rKJunN0hYHRxSh4DwVHUXY%2FStrCmpA;product=StringUtils;version=3.5.15.0
Best regards,
Marcel
Hello,
thank you very much for your answer.
Just one more thing, do you strictly recommend to reduce the use of string comparison or because nowadays the cpu are very powerful so the time for string comparison is also negligible?
Thank you.
Best regards
Hello,
it is always a good idea to only do things if you need to do them ;)
Best regards,
Marcel
Hello,
yeah clear.
Thank you very much,
Best regards