on 11-08-2011 7:40 PM
Hi Experts,
The Source field SourceField1 is mapped to TargetField1 and the length of TargetField1 is of 20 characters only. Lets Suppose If I'm getting one space in the begining then it is causing the problem while generating value in Target.
Lets suppose the value in <SourceField1>00007633574593990389</SourceField1> then the exact value will go in target field, but if there a single space than I may not get the exact value (<SourceField1> 00007633574593990389</SourceField1> then <TargetField1> 0000763357459399038</TargetField1>) . Can anybody provide me UDF wherein I should check if first character is space then it should ignore it and pass correct value.
Regards
Faisal.
use standard text function trim() to remove leading (in the beginning empty space) and trailing (ending) space. You dont need UDF for this.
Source field --> trim -> target field
If you want udf still same, create simple udf function pass source value as string parameter (ex str) and return value as string
Example:
public String trimString(str a){
return str.trim();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fisal,
U no need to use any UDF for this.
As Basker Gopal mentioned you can use the Trim function.
Regard's
Preethi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You can use this logic:
SourceField1 -> substring: 1..20 -> \
SourceField1 -> substring:0..1 -> equalsS -> ifThenElse -> Target
Constant: -> / SourceField1 -> /
note: value of Constant is a space
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.