Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
cdb
Former Employee
Former Employee

Fetch the Index of the string

Hi,

I need to fetch index of lang code .Postion of the language code can be different ,so I need to search id the language code provieded in my mapping exist ,if it does I need to get the index of it.

languages:

mapping load *

Inline [

Code, Lang

de-DE, German

en-US, English

es-ES, Spanish

fr-FR, French

it-IT, Italian

ja-JP, Japanese

ko-KR, Korean

nl-NL, Dutch

pl-PL, Polish

pt-BR, Portuguese

ru-RU, Russian

sv-SE, Swedish

zh-CN, Chinese

tf-TR,Turkish

zh-TW,Chinese

];

Sample Filename where we need to search the language code and return the index

  

$/Ver12.00/ua_rel/sense_4.2/doc/APIs/RepositoryServiceAPI/de-DE/Content/RepositoryServiceAPI/RepositoryServiceAPI-Tag-Create.htm
$/Ver12.00/ua_rel/sense_4.2/doc/Deployment/en-US/Content/Deployment/Deploying-QSM-per-app-vpn-AirWatch.htm

Any help will be appreciated

2 Replies
shraddha_g
Partner - Master III
Partner - Master III

Tyr Subfield (Filename,'/', -4)

cdb
Former Employee
Former Employee
Author

Thanks Shraddha ,It worked but I had to tweak a  bit to make it correct.

Shraddha Gajare <span class="icon-status-icon icon-partner" title="Partner"></span> wrote:

Tyr Subfield (Filename,'/', -4)

ApplyMap('languages', Subfield (@1,'/', -3),

ApplyMap('languages', Subfield (@1,'/', -4),

ApplyMap('languages', Subfield (@1,'/', -5),

ApplyMap('languages', Subfield (@1,'/', -6),

'Unknown')))) As LangN