From: Chirag Shah Date: 2011-07-27T21:41:06+09:00 Subject: Re: String manuplation example You have static value '/dev/sda4'? then you can do the following You can do gsub i.e st = "/dev/sda4 45225016 3702464 39225208 9% /" stv = st.gsub("/dev/sda4") your_value = stv.to_a[0] kotin 76 wrote in post #1013327: > Hi, > > I am new to ruby. > > I tried to extract the word from /dev/sda4 from below string. I did not > get exact logic for this. > > the string is below one( spaces are there between words) . > > string = "/dev/sda4 45225016 3702464 39225208 9% /" > > please any one let me know the logic to extract word from /dev to endof > that word. it mean up to /dev/sda4. > > > i would appreciate any answer. > > Regards > Kotin -- Posted via http://www.ruby-forum.com/.