get value from ( )

User avatar
sal21
PlatinumLounger
Posts: 4344
Joined: 26 Apr 2010, 17:36

get value from ( )

Post by sal21 »

MYSTRING="415063049-NAPOLI-(NA)"

How to get the value NA from braket ( )?

note:
the string have a dinamic lenght but the value in bracket is fixed from ( )

User avatar
HansV
Administrator
Posts: 78398
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: get value from ( )

Post by HansV »

Mid(MYSTRING, InStr(MYSTRING, "(") + 1, InStr(MYSTRING, ")") - InStr(MYSTRING, "(") - 1)
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2628
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: get value from ( )

Post by jstevens »

Hans,

:cool:
Regards,
John

User avatar
sal21
PlatinumLounger
Posts: 4344
Joined: 26 Apr 2010, 17:36

Re: get value from ( )

Post by sal21 »

HansV wrote:
06 May 2021, 10:56
Mid(MYSTRING, InStr(MYSTRING, "(") + 1, InStr(MYSTRING, ")") - InStr(MYSTRING, "(") - 1)
WORK!
tKS