Usually it involves other functions nested somehow. Impossible to be even remotely specific about that without some kind of sample data and a good idea of how representative the sample is compared to the full data set. In other words, what's also important is if there is some kind of key that can be used, such as 'always return/extract all/n of the characters after the first 0 on the left/right'. Seldom are these issues fully explained at the outset - it takes a few tries to nail down a pattern and thus a solution.
EDIT - afterthought: if you're saying that you tried to use a variable and a function would not recognize a value for that variable, then that is another issue. Variables will work in functions such as Left as long as they contain a value that the function will accept.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.