on 07-22-2009 3:07 PM
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.
Re above
'Fred Joe Sid Andy Bloggs' to become 'Fred Joe Sid Andy Bloggs'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's worked fine.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This wonderful forum software does just what I want, it reduces multiple spaces to single spaces.
Just try and imagine the first string with lots of spaces.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In script it's pretty simple to remove the extra spaces. For example:
$instring = 'Fred Joe Sid Andy Bloggs';
print($instring);
while (index($instring, ' ', 1)>0)
$instring=replace_substr( $instring,' ',' ');
print($instring);
Just take the while and the line after and put them into a function and you can call it from a mapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or, referring to above,
does anybody have the correct pattern string to match the following
'alpha_string||space_string||alpha_string||space_string||alpha_string||space_string||alpha_string'
i.e 'Fred Joe Sid Dave Bloggs'
Thanks again,
Eric.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.