Here's a way to sort Strings based on the number that follows the first underscore in each String:
| sortedNames names |
names := #( 'text_10' 'text_1' 'text_100').
sortedNames := names asSortedCollection sortBlock: [ :str1 :str2 | (str1 copyFrom: (str1 indexOf: $_) + 1 to: str1 size) asNumber < (str2 copyFrom: (str2 indexOf: $_) + 1 to: str2 size) asNumber ].
sortedNames asArray