there are several ways to achieve this. Simple oneliner would probably be to create a substring of characters that come after the last whitespace.
lastWord = wholeString.Substring(wholeString.LastIndexOf(" ") +1) // +1 is there in case you wholeString happens to be just single word
In your case this would include the brackets also “12345)]” so you would have to remove them.
There is an Replace activity in UiPath which can be easily used to manipulate strings.
Input= your sentence
Pattern="[^0-9]" // removes everything except numbers
Ps. If your input sentences are all of this format => you only want the numbers presented then the Replace is all you need.