Search code examples
xpagesxpages-ssjs

Instr method in Javascript XPages


Which method i can use in ServerSide Javascript instead of Instr method in LotusScript

Regards
Cumhur Ata


Solution

  • Use

    yourString.indexOf(yourSubstring)
    

    It returns a value >= 0 if yourSubstring is part of yourString.
    It is the position of yourSubstring in yourString starting with 0.
    This is different to LotusScript's InStr which starts with 1.