on 10-31-2008 2:32 PM
Hello sdn
If I have a variable
a = A1234
then i want to add a semicolon to it,else if a =A1234; then i dont want to add semicolon to it as it already has a semi colon.
Can i get to know the java code to achieve this?
Thanks
Hi,
you could use this:
> if (! (a.lastIndexOf(";") == (a.length() - 1))) {
> a += ";";
> }
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use below code.
if ( a.indexOf(";") > -1 ) //if not present.
{
a = a+";";
}
as said above, you can use standard string function indexOf
http://help.sap.com/saphelp_nw04/helpdata/en/c8/98e7d5c1620642973565ea3dd319d1/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
u can use fixed value mapping give default value as A1234; and in the input give A1234 and output A1234; ad map it to target.
its the only value which going to come form input or along with this u may have different values as well,the above solution will work for that input value only.
if u r using java mapping then u have to use .equals function to compare the input values.
if(input.equals("A1234;")
{
result (A1234;)
}
else
result(A1234;)
or u can use graphical function constant,equals etc.
chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.