Perhaps, you are known that the veteran programmers of this Forum discourage to use the String data type in programming particulalrly in AVR Flatform. However, you are safe in DUE Platform as it contains a 32-bit MCU with large on-board memory.
It would still be a good practice to avoid the use of String data type in favor of cstring; where, strcmp() function could be used to compare two strings.