First Character as uppercase character
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 103
- Joined: Wed Jul 06, 2005 12:29 am
First Character as uppercase character
Which function in transformer do I need to use to find whether the first character of a string is upper case or not.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If
Use substring or Left() to isolate the first character.
Test this against itself with the UpCase() function applied, or against an upper case alphabet using the Index() function.
Use If to generate an int8 result.
Use substring or Left() to isolate the first character.
Test this against itself with the UpCase() function applied, or against an upper case alphabet using the Index() function.
Use If to generate an int8 result.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Re: First Character as uppercase character
Depends on your exact requirement.
or
Code: Select all
If (Left(InputLink.InputColumn,1) > CHAR(64) and Left(InputLink.InputColumn,1) < CHAR(91)) then 'Y' else 'N'
Ex: "1test" will give you 'N'
Ex: "test" will give you 'N'
Ex: "Test" will give you 'Y'
Code: Select all
If (Left(InputLink.InputColumn,1) = UpCase(Left(InputLink.InputColumn,1))) Then 'Y' else 'N'
Ex: "1test" will give you 'Y'
Ex: "test" will give you 'N'
Ex: "Test" will give you 'Y'
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Performance Tip
Putting the Left() function result into a stage variable would mean that you execute it once per row rather than twice per row. For squillions of rows this can make a noticeable difference.
Putting the Left() function result into a stage variable would mean that you execute it once per row rather than twice per row. For squillions of rows this can make a noticeable difference.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.