• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] problem with string test

#1 2010-04-01 16:04:26

KSCHAPMAN
Guest

[resolved] problem with string test

Tags: [equals, string, trim]

Hi,

I've a problem with this :

(Relational.ISNULL(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE))?"":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE)=="inférieur CAP - BEP (Brevet des colléges, CFG, …)")?"inférieur BAC":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE)=="CAP - BEP")?"inférieur BAC":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE)=="BAC")?"BAC":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE)=="BAC + 2")?"DEUG":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE)=="BAC + 3")?"Licence":
"Licence ou plus"

And it always return me "Licence ou plus" even if the string is "BAC" for example.
So i've tested :

(Relational.ISNULL(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE))?"":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE)=="inférieur CAP - BEP (Brevet des colléges, CFG, …)")?"inférieur BAC":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE)=="CAP - BEP")?"inférieur BAC":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE)=="BAC")?"BAC":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE)=="BAC + 2")?"DEUG":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE)=="BAC + 3")?"Licence":
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE))

And it return me "BAC" or "BAC + 2" ...

The function StringHandling.TRIM delete right and left blank ?

Can you help me please ?

#2 2010-04-02 05:10:32

shong
Talend team
Registered: 2007-08-29
Posts: 10310
Website

Re: [resolved] problem with string test

Hello
To compare a string with anther one, using the method String.equals(String s),  for eaxample:
(StringHandling.TRIM(row1.Diplome_obtenu_le_plus_eleve_avant_la_VAE).equals("BAC + 3")?value1:value2

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#3 2010-04-02 12:24:29

KSCHAPMAN
Guest

Re: [resolved] problem with string test

Hi,

Yes thanks.
My problem is solve.

Good week end

#4 2010-05-03 12:32:28

Banayotshna
New member
Registered: 2010-04-30
Posts: 9

Re: [resolved] problem with string test

how to trim first 8 characters in a string?

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] problem with string test

Board footer

Powered by FluxBB