Skip to Content
0
Former Member
Jul 22, 2009 at 02:07 PM

Word count in string

544 Views

Can anybody suggest a solution for the following scenario ?

I want to either

a) transform a full name string which may contain multiple spaces to one containing single spaces i.e.

'Fred Joe Sid Andy Bloggs'

to become

'Fred Joe Sid Andy Bloggs'

or

b) count the component words in the string, the above full name string would return 5.

I've tried match_pattten with no luck.

There is an Oracle function , regexp_replace which would do for a) .

Thanks,

Eric.