|
In article <fp79m5$a24$1@fred.mathworks.com>,
"us " <us@neurol.unizh.ch> wrote:
> "sushma sharma":
> <SNIP points out that <us> didn't read his/her OP
> correctly...
>
> sorry...
> now one of the solutions might look like this
>
> s={
> 'NDL_OK_2_R515_Japan'
> 'NDL_OK_2_R515_Japan'
> 'NDL_OK_2_R515_Japan'
> };
> ix=strfind(s,'_');
> r=cellfun(@(a,b) a([1:b(3),b(3)+2:end]),...
> s,ix,'uni',false);
> disp(r);
> %{
> 'NDL_OK_2_515_Japan'
> 'NDL_OK_2_515_Japan'
> 'NDL_OK_2_515_Japan'
> %}
>
> us
And another solution could be (using s from above):
regexprep(s,'([^_]*_){3}.(.*)','$1$2')
--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.
|