Using NRIC.no to calculate and retrieve last alphabet

Hi guys

**Will like some help here. How am I to extract out the 7928964 from **

S7928964G and how am I to convert this string to int format?

The check digit of the NRIC No. is the official reference which is determined as follows:For example: NRIC No.(with official reference) =

S 7928964 G

Step 1: Multiply each digit by the following weights:

NRIC No.: 7 9 2 8 9 6 4

Weights: 2 7 6 5 4 3 2

Products: 14 63 12 40 36 18 8

Step 2: Sum up all the products found in step 1:

Sum: 14 + 63 + 12 + 40 + 36 + 18 + 8 = 191

Step 3: Find the remainder when the sum is divided by 11.

Remainder: 191 / 11 gives remainder of 4

Step 4: Take 11 – remainder to get the check digit.

Check digit: 11 – 4 = 7

Step 5: Look up the following table to get the official reference:

Check Digit 1 2 3 4 5 6 7 8 9 10 11

Reference A B C D E F G H I Z J

Official Reference: G

Will appreciate if some hints given. Am kind of confused over here:confused: