To replace only the first occurrence of a pattern with with another expression use the sub method "string ring".sub('r', 'l') # => "stling ring".
確定! 回上一頁