StudentFirstName is a variable and is databound to an excel spreadsheet. Just realised that all the firstnames in the spreadsheet have trailing spaces, like Nanci is "Nanci " in the spreasheet. When I use the above statement to set value into the first name field it is still setting "Nanci " instead of “Nanci”
Am I using the correct syntax for trim() ? Should I be using replace instead?
When I tried to get the text from the first name field, I got an error message for this line of code
String StuFirst = WebUI.getText(‘Admin Portal/Page_Certification App/input_First Name_firstName’).trim().
Also instead of trim(), I used replace(), still shows the trailing space. This is so bizarre. Can it something other than a space after "Nanci ", but not sure what character it can be?
I tried for space and carriage return or linefeed so far. I can just update my spreadsheet but I wanted to adjust my code so that I dont have to worry about the values in the spreadsheet.
Feeling silly that I did not check the html after I entered the name in the input field using the variable… it showed Nanci . But thanks @kazurayam for helping me figure this out!