cancel
Showing results for 
Search instead for 
Did you mean: 

How to search for a string

Former Member
0 Kudos

Hi All,

My requirement is to search string Like "List Price",if the input field is having this string at any place i need to transfer input value to target.

Could any one help me on this writing a UDF for this.

Input : Final List Price Vendor

check for :List Price

then pass the other values to Target.

Thanks,

Madhu

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

guess you can do it with standard functions:

Use the replaceString function to replace "List Price" with "" for your inputValue.

Then compare the result with the original inputValue (without replaceString).

If length is not equal (if without else)

then targetValue = replaced inputValue

Regards

Patrick

Former Member
0 Kudos

public void search(String[] a,ResultList result,Container container){

String check = "List Price";

for(int i= 0;i<a.length;i++)

{

if(a<i>.indexOf(check) >= 0)

result.addValue(a<i>);

else

result.addValue(" ");

}

}

Regards

Sreedivia

Former Member
0 Kudos

Hi,

Check with this UDF

public String Search(String a,String b,Container container)
{
String c;
int i;
i = a.indexOf(b);
if(i == -1)
   c = " ";
else
   c = a;
return c;
}

Here a is the input and b is the search string.

0r

if the value of search string doesnt change dynamically then the UDF can be like this


public String Search(String a,Container container)
{
String c;
String b;
b = "List price"
int i;
i = a.indexOf(b);
if(i == -1)
   c = " ";
else
   c = a;
return c;
}

Edited by: malini balasubramaniam on Aug 5, 2008 9:15 AM

santhosh_kumarv
Active Contributor
0 Kudos

Hi Madhu,

No need of UDF..

Use the Standard Function startsWith text function with the combination of if-else condition.

Thanks

SaNv...

Former Member
0 Kudos

Hey

Just write a simple UDF for this.

Thanx

aamir

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi,

use Xpath code inside the condition Editor in Receiver Determination

see this

Tjhaks

Rodrigo