Substring operations can be performed using square brackets [start,length].
As a derivation for your stage var you could use:
stagevar=sourcecolumn[4,1].
For other interesting forms to use [] please refer to the documentation.
Regards
Stephan
Select the 4th byte in a String
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A substring based approach only works in bytes if a single-byte character set is in use. Since the OP is in the USA this is a fair, but by no means guaranteed, assumption.
All the substring functions actually work with characters which, in multi-byte character sets, is not the same thing as bytes. Stephan's answer gives you the fourth character from a string. There do exist functions such as BYTE, BYTELEN, BYTETYPE and so on for extracting and identifying specific bytes from a string in a multi-byte character set, but these are largely meaningless for all practical purposes.
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
All the substring functions actually work with characters which, in multi-byte character sets, is not the same thing as bytes. Stephan's answer gives you the fourth character from a string. There do exist functions such as BYTE, BYTELEN, BYTETYPE and so on for extracting and identifying specific bytes from a string in a multi-byte character set, but these are largely meaningless for all practical purposes.
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518