Extracting substring of variable length

is there any way to do what i wanted when using a String at all? I mean extract a substring of variable length from a String, not from a string[]

Yes. The methodology is exactly the same. Find the start position. Find the end position. Extract the data in between.

I recommend steel toed shoes while you shoot yourself in the foot. Less damage to your foot that way.