LPS-51028 Compute length without string concatenation