@bevik
Yep...was wondering about this a bit as I've not had to deal with leading spaces as much as trailing spaces.
It does indeed removing the leading spaces as you are seeing but ONLY in the viewers that you are looking at (i.e. the variable viewer)
The fact is that the spaces are still there.
To make sure I wasn't going crazy, I threw this in an app
Set(flowResult, "123, REC 1|dfg,dfg,dfg,df,dfg, REC 2");
Set(xxx, ForAll(Split(flowResult, "|"),
{Res: Last(Split(Result, ",")).Result, cnt: Len(Last(Split(Result, ",")).Result)}
)
);
The variable viewer showed flowResult as:

It also showed the xxx variable as:

NOTE from the formula above, that cnt was set to the count of letters in the Res column. So for the first, it appears that it is just 5 letters, but the cnt shows it as 18.
Placing the following in a label:
"@" & First(xxx).Res
Shows:

So, the spaces are definitely there.