From the string x = "DIMENSION: 17" I want to extract the integer and load it into n (in general, the string need not end in 17). This command works:
n = StringCases[x, "DIMENSION:" ~~ Whitespace ~~ (y : DigitCharacter ..) -> y] // First // ToExpression;
But there must be a much simpler way. What is it? Thankx.