on 05-16-2007 4:34 PM
Hi
did any1 used User Defined Function to format string ?
I get supplier code with 4 or 5 chars and I need to convert it in mapping
to a 15 length field which the other chars will be spaces
thx,shai
thx
it was v.helpfull
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shai,
Create a <b><i>Value</i></b> UDF with one input parameter <b><i>String</i></b> and name the UDF as <i><b>PadString</b></i>.
Then add this code:
import java.*;
while (String.length()<Integer.parseInt("15"))
{
String = String + " " ;
}
return String;
It will give you the result what you have expected.
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.