String manipulation syntax

Hello guys,

I would like to kindly ask for a syntax in String manipulation Node.

I have this form of time periods:

W50 19

W52 19

W01 20

And I need to transform in this:

from W50 19 to 201950

from W52 23 to 202352

from W07 21 to 202107

where W50 or W07 is a week and 23 or 19 is a year always

so the final form is 201950

could you please help me with syntax?? many thanks in advance!!