The String class has the trim() function to remove non-printable characters (ie. '\r', '\n') from the end of the String and the toLowerCase() and toUpperCase() functions to set the case of the input String.
You will have to determine what Labview uses for a line ending and incorporate the ascii characters of that line ending into your String comparison.
EDIT: I see that groundFungus has recommended the trim function, and that is a goo altlernative
For example if its carriage return + new line then if(a=="123\r\n"){
If its just a new line then if(a=="123\n"){
This illustrated the use of the trim() function on the input String. The line endings in serial monitor can be set to anything with this example. If line feed ('\n') or carriage return ('\r) are appended by serial monitor, trim() will remove them. The LED will flash 1 second on receipt of "123", "123\r", "123\n", or "123\r\n".
const byte FR = 13;
void setup()
{
Serial.begin(9600);
pinMode(FR, OUTPUT);
}
void loop()
{
while (Serial.available())
{
String a = Serial.readString(); // read the incoming data as string
a.trim();
Serial.println(a);
if (a == "123")
{
digitalWrite(FR, HIGH);
delay(1000);
digitalWrite(FR, LOW);
}
}
}