str = "A30-60_10000"
str.sub(/_.*/, "")
Résultat ↓
=> "A30-60"
str.sub(/.*_/, "")
"10000"
référence https://qiita.com/flmil/items/8cbfbf49844ddef79000
Recommended Posts