If we do the same, but add the substring() function to concat(), the result will be incorrect (example 2). As seen in example 2, the function substring(), which should have printed 4 characters, has printed only 3.
Please tell me why the result is not correct?
Because substring only works for text inputs and produces text output so your insignificant whitespace is thrown away if you pass data through that function.
It isn't a bug but a missing feature. Given that the project basically doesn't recommend people use char this gap in functionality isn't surprising.