You could try a calculation like this:
if(ends-with(${qrcode}," "),substr(${qrcode},0,string-length(${qrcode})-1),${qrcode})
Your QRCode question could be flagged to have an esriFieldType of null.
Then you would add a hidden question and add the calculation above.
If you do not want to change the geodatabase schema, then you can do the following:
Convert your barcode question into a hidden question and add the calculation above to it.
Add a new barcode question, set the label and all as you like and MAKE sure you have it as esriFieldType null