on 11-22-2013 6:45 AM
HI,
Can u please help me in writing UDF for example below :
input,output and logic is as follows :
INPUT is -
<D>6 x 1 L Milk</D>
OUTPUT
<E>6</E>
Logic -
Character string to the left of " x " if " x " occurs in the first 8 characters of D.
Regards
Hi,
can you try below code.
String s ="6 x 1 L Milk";
int i;
s = s.replaceAll(" ","");
i =s.indexOf("x");
if(i>=1 && i<=7)
{
s=s.substring(i-1,i);
return s;
}
if x comes in first like "x1234567" it will not return anything.
Regards,
Muniyappan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 | |
7 | |
6 | |
5 | |
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.