How to get the first letter in a string
book
Article ID: KB0075736
calendar_today
Updated On:
Description
How can I get the first letter in a string using the StreamBase Expression Language?
Resolution
Use the
substr function, as described in the Help under
StreamBase Home > StreamBase References > StreamBase Expression Language Functions. For example:
>> sbd --eval "substr('ABC',0,1)"
(string) A
In the above example, the first argument,
ABC, is the parent string. The second argument specifies the sub-string's start position in the parent string. In this case it's 0 because we want the first character. The last argument specifies the sub-string's total length. In this case, it's 1.
Issue/Introduction
How to get the first letter in a string
Feedback
thumb_up
Yes
thumb_down
No