Loading ...
Sorry, an error occurred while loading the content.

646Re: [id-ruby] tanya regexp dong

Expand Messages
  • Ronny Haryanto
    Jun 1, 2006
    • 0 Attachment
      On Thu, Jun 01, 2006 at 09:05:22AM -0000, ginanjar_utama wrote:
      >
      > aku ingin replace
      > string 'j' dalam
      > 'Dajat' jadi 'Dayat'
      > tapi kalo
      > 'Joni' tetap 'Joni'
      >
      > caranya gimana ya milih huruf j yang cuma ada di tengah kata
      >

      mystring.gsub!(/\Bj/, 'y')
      mystring.gsub!(/\BJ/, 'Y')

      Ronny
    • Show all 5 messages in this topic