on 03-10-2008 12:15 PM
for Example my Purchase order number is like this :
KL0000098654------ I need to Convert to 10 digit Purchase order
First two Alphabetical Must be there I need to remove two Zerosof left side ( After Alphabetical ) .
Is there any Java code for this.
Praveen,
Write the below code.
String ponum="";
if (a.length() <11)
{
return a;
}
else if (a.substring(2,4).equals("00"))
{
ponum=a.substring(0,2)+""+a.substring(4,a.length());
return ponum;
}
else
{
throw new RuntimeException("PO Number can't be converted to 10 Digit");
}
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First of all take the vlaues in two substrings and then concatinate. But are you sure that there will always tow Alphabets in the begining then do lik this.
Source ( KL0000098654) -
> substring (0..2)
Source ( KL0000098654) -
> substring (4..8) -
> Concatenate -
> Target ( KL00098654)
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
We have the standard funtions in grahical mapping tyr to use them....in ur requirement u can use substring funtion.
Regards,
Phani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can take the substrings of the input( first 2 alphabets of the string and den last 8 digits) and then concatenate them. That is a work around. I think it should work.
Thanks and Regards,
Sanjeev Shekhar Singh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
12Hello,
you can use the standard functions concat and substring.
substring1 (0, 2)
substring1(4, 😎
concat substring1 + substring2
The functions are described here (p. 49 and 50):
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.