Join wMUsers | Blog at wMUsers | Edit my wMUsers Profile | Site Map | webMethods Jobs |For Employers

wMUsers  
  #1  
Old 01-30-2010, 17:25
david123 david123 is offline
Member
 
Join Date: Nov 2008
Posts: 86
Thanks: 4
Thanked 0 Times in 0 Posts
Default How to find the last element in a string

Hi all,

I have a requirement..

For eg: If a string has a value...lets say 1234.50

I must do left padding with zeroes and remove the decimal to a length of 13.

I have done till that....the output is 0000000123450. Now, My requirement is that......the last digit has 0 value...so i have to replace it with {

if the last digit is 1 i must replace it with A.
2 with B and so on.

So, For eg....here 0000000123450 must appear as 000000012345{
0000000123451 must appear as 000000012345A
0000000123452 must appear as 000000012345B

Can anyone tell the logic how to replace the last digit. If possible, please include the steps...so that it would be clear for me.

Thanks in advance,
David.
Reply With Quote
Advertisement
  #2  
Old 01-30-2010, 21:56
alamir2020 alamir2020 is offline
Junior Member
 
Join Date: Jun 2009
Posts: 20
Thanks: 2
Thanked 2 Times in 1 Post
Default

Hi David

Use pub.string:substring and set beginIndex =13 and endIndex =14.
Then add a branch then paste the /value in the Switch property.
After that add Sequences below the branch and label each one 0,1,2,..,9.
In the sequence with the label 0 add a pub.string:substring below it and take the first 14 digit then add pub.string:concat to concatenate the value retuen with the { symbol.

Thats all.
Reply With Quote
  #3  
Old 01-31-2010, 16:02
david123 david123 is offline
Member
 
Join Date: Nov 2008
Posts: 86
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Thank you very much alamir. That really worked.
Reply With Quote
  #4  
Old 01-31-2010, 22:21
alamir2020 alamir2020 is offline
Junior Member
 
Join Date: Jun 2009
Posts: 20
Thanks: 2
Thanked 2 Times in 1 Post
Default

My pleasure
Reply With Quote
  #5  
Old 02-01-2010, 09:50
reamon's Avatar
reamon reamon is offline
Premium Member
 
Join Date: Apr 2003
Posts: 4,789
Thanks: 61
Thanked 177 Times in 140 Posts
Default

What you're describing as the target format is known as zoned decimal. The PSUtilities package from SAG/wM has a convertStringToZonedDecimal service you can copy. It handles leading signs, negative numbers, padding, stripping the decimal, etc.
__________________
-Rob
http://reamon.squarespace.com
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ADK custom adapter - how to get string field in document list on input ? kf777 Application Adapters 4 11-04-2008 10:44
How to dynamically map a String Table at run-time? jludovic Flow and Java services 0 01-08-2008 07:09
returning xml document (complete) as string from web service leesik SOA Service Development (Web Services, SOAP and WSDL) 2 12-28-2007 16:33
Not able to convert replyevent to Pre-defined Storage Class prasadba Broker 3 03-05-2007 01:57
jxl.* jar File Not Found.. nightfox Flow and Java services 4 10-11-2006 13:51


All times are GMT -6. The time now is 00:55.


.
All Content Copyright ©2002-2009, Conneva, Inc. DBA wMUsers.Com

wMUsers is an independent organization and is not sponsored in any manner by Software AG or webMethods, Inc.

Page generated in 0.08005 seconds with 18 queries