On Apr 18, 2008, at 7:32 AM, Peter Loftus wrote:

>    val = "     hello     ".sub(/\t/, ' ')
>    puts val
>
> Cant covert tabbed spaces into regular single spaces
> Anyone have any ideas?

Use the String#tr comand

str = "string\twith\ttabs"
str.tr("\t", " ")


Blessings,
TwP

(and from the RDoc ...)

str.tr(from_str, to_str) => new_str

Returns a copy of str with the characters in from_str replaced by the  orresponding characters in to_str. If to_str is shorter than  
from_str, it is padded with its last character. Both strings may use  
the c1ΝΔ2 notation to denote ranges of characters, and from_str may  tart with a ^, which denotes all characters except those listed.

    "hello".tr('aeiou', '*')    #=> "h*ll*"
    "hello".tr('^aeiou', '*')   #=> "*e**o"
    "hello".tr('el', 'ip')      #=> "hippo"
    "hello".tr('a-y', 'b-z')    #=> "ifmmp"