Six Stars

Talend tMap if condition for mathematical symbol as string

I have a column in a table and some values has back slash / towards end. i want to remove these slash value and retain the rest of text. so lets say i have a text "myjunkdata/", it should give me back "myjunkdata". However below condition is not working.

 

 

 

(StringHandling.RIGHT(row1.CertificateName,1) == "/") ? StringHandling.LEFT(row1.CertificateName,StringHandling.LEN(row1.CertificateName)-1) : row1.CertificateName

 

 

example data below

Certified SOA Security Specialist/
Information Security Management Principles Foundation Certificate/
Check Point Certified Security Administrator  R77/
Check Point Certified Security Expert  R77/
Check Point Managed Security Expert/
Cisco Certified Network Associate Security
Cisco Certified Network Professional Security
Cisco Certified Internetwork Expert Security
Cisco Certified Network Professional Security 

Can anyone help?

 

 

 

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Five Stars

Re: Talend tMap if condition for mathematical symbol as string

Can you please try with below one

StringHandling.RIGHT(row1.CertificateName,1).equals("/")? StringHandling.LEFT(row1.CertificateName,StringHandling.LEN(row1.CertificateName)-1) : row1.CertificateName

4 REPLIES
Six Stars sgv
Six Stars

Re: Talend tMap if condition for mathematical symbol as string

Hi,

row1.CertificateName.replace("/","")

 

Good luck

SGV

Six Stars

Re: Talend tMap if condition for mathematical symbol as string

Not helpful. there are / symbols in the middle area too, which i want to retain. i only want to remove the ones appearing at the end. Thanks!

Five Stars

Re: Talend tMap if condition for mathematical symbol as string

Can you please try with below one

StringHandling.RIGHT(row1.CertificateName,1).equals("/")? StringHandling.LEFT(row1.CertificateName,StringHandling.LEN(row1.CertificateName)-1) : row1.CertificateName

Six Stars sgv
Six Stars

Re: Talend tMap if condition for mathematical symbol as string

(row1.CertificateName.lastIndexOf("/") == row1.CertificateName.length()-1)?

row1.CertificateName.subSequence(0, test.length()-1) : row1.CertificateName