how to find Last index of the substring in a string?

One Star

how to find Last index of the substring in a string?

hello,
if i have a string "hello how are you?test?12?are^&%^"
How to find the index of the last "?"
kindly suggest me for this issue ..
Thanks in advance
nilesh r
One Star

Re: how to find Last index of the substring in a string?

Method lastIndexOf(String str) of the String class Smiley Happy
One Star

Re: how to find Last index of the substring in a string?

i dont have such option in string class . im using "talend open studio 4.1.1 r50363..
is there any other option to do so?
One Star

Re: how to find Last index of the substring in a string?

Well, why not a little While loop with method indexOf(String str, int fromIndex) ? Or a For one, char by char. Can't tell you more Smiley Happy
One Star

Re: how to find Last index of the substring in a string?

If it's a Java project use stringname.lastIndexOf('?')
One Star

Re: how to find Last index of the substring in a string?

i need to do the same inside tmap with some string function .because i have some process done inside my "tmap" .
Im beginner level in talend .pls suggest me..
One Star

Re: how to find Last index of the substring in a string?

i need to do the same inside tmap with some string function .because i have some process done inside my "tmap" .
Im beginner level in talend .pls suggest me..

So what do you want to do?

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog