Hi
I need to ask something
I am trying to retrieve a value from a string and I have noticed the following:
Scenario:
- I have retrieved lines from a file and need to read each line to retreive a certain string from the line i.e.
LINE = "THISISATES T"
I would need to retrieve the work TEST for processing.
I have noticed that when I declare string - and then parse for the value like string[8:4] it gives me a blank, but when I say string[8:len(string)], I get a value.
The problem comes in when I am trying to retrieve a value before the end of the string i.e. If I had to get the value ISA.
How do I do it, because using the string[0:0] format does not work - or does it?
Am I using it incorrectly?
Should I be using something like the find/ rfind command?
Thanks
Yudesh
I need to ask something
I am trying to retrieve a value from a string and I have noticed the following:
Scenario:
- I have retrieved lines from a file and need to read each line to retreive a certain string from the line i.e.
LINE = "THISISATES T"
I would need to retrieve the work TEST for processing.
I have noticed that when I declare string - and then parse for the value like string[8:4] it gives me a blank, but when I say string[8:len(string)], I get a value.
The problem comes in when I am trying to retrieve a value before the end of the string i.e. If I had to get the value ISA.
How do I do it, because using the string[0:0] format does not work - or does it?
Am I using it incorrectly?
Should I be using something like the find/ rfind command?
Thanks
Yudesh
Comment