SQL - sGrabBetween (SubString)

alter procedure sGrabBetween

  @Text as nvarchar(MAX),

  @First as nvarchar(MAX),

  @Second as nvarchar(MAX)

    AS


SELECT SUBSTRING(@Text, CHARINDEX(@First, @Text) + LEN(@First),

                 CHARINDEX(@Second, @Text) - CHARINDEX(@First, @Text) - LEN(@First))



--exec sGrabBetween @Text='Hi there richard',@First='Hi',@Second='ard'


Split String into n- number of characters per line

In this example, it's splitting on 8 characters per line

Dim orig = "12344321678900987"
Dim res = Enumerable.Range(0,orig.Length\8).[Select](Function(i) orig.Substring(i*8,8))

https://stackoverflow.com/questions/8774392/how-to-split-a-string-by-x-amount-of-characters


.