You could also do it without strings. You only need very basic math for this.

If you want to shift a number to the left by a certain number of digits you just multiply with a power of 10.

For example: 14 * 10^6 == 14 000 000

And if you want the last 2 digits of a number you can do modulo calculation with a power of 10.

For example: 2014 % 10^2 == 14

So if you are given the year and a number of 6 random digits you can simply do:

(year % 10^2) * 10^6 + rndNum

For year == 2014 and rndNum == 123456 the result would be:

(2014 % 10^2) * 10^6 + 123456

== (2014 % 100) * 1000000 + 123456

== 14 * 1000000 + 123456

== 14000000 + 123456

== 14123456

which is what you want.