How can I get specific char in string, between char space and 'IU' like this:
BEMFOLA 225IU/0,375ML
BEMFOLA 300IU/0,5ML
Result:
225
300
How can I get specific char in string, between char space and 'IU' like this:
BEMFOLA 225IU/0,375ML
BEMFOLA 300IU/0,5ML
Result:
225
300
Here is one method with charindex
and substring
declare @var varchar(16) = 'BEMFOLA 225IU/0,375ML'
select SUBSTRING(@var,charindex(' ',@var),charindex('IU',@var) - charindex(' ',@var))
If IU
can be any two characters, then you can use:
select SUBSTRING(@var,charindex(' ',@var),charindex('/',@var) - charindex(' ',@var) - 2)
This takes the substring of your string from the first space, to two places before the slash.