J
Jason Vogel
Disclaimer : Ruby Nuby and I don't know RegEx basically at all. I know
RegEx is the answer, just don't know where to start.
Current Source:
str.split(' ').each {|w| w.capitalize!}.join(' ')
Text:
ADDITIONAL SPA (ONLY AVAILABLE W/PURCHASE OF POOL OR SPA)
SELLER HEAT/AC/DUCTWORK
Result:
Additional Spa (only Available W/purchase Of Pool Or Spa)
Seller Heat/ac/ductwork
Desired:
Additional Spa (Only Available w/Purchase of Pool or Spa)
Seller Heat/AC/Ductwork
Isssus:
- Need to capitalize after a "/'
- Need specific word case handling (e.g. "Ac" => "AC","or" => "or",
"w/[a]" => "w/[A]")
Thanks,
Jason
RegEx is the answer, just don't know where to start.
Current Source:
str.split(' ').each {|w| w.capitalize!}.join(' ')
Text:
ADDITIONAL SPA (ONLY AVAILABLE W/PURCHASE OF POOL OR SPA)
SELLER HEAT/AC/DUCTWORK
Result:
Additional Spa (only Available W/purchase Of Pool Or Spa)
Seller Heat/ac/ductwork
Desired:
Additional Spa (Only Available w/Purchase of Pool or Spa)
Seller Heat/AC/Ductwork
Isssus:
- Need to capitalize after a "/'
- Need specific word case handling (e.g. "Ac" => "AC","or" => "or",
"w/[a]" => "w/[A]")
Thanks,
Jason