javascriptadobe-indesignbasil.js

Syntax of b.startsWith() in basil.js


I was wondering how the syntax of the b.startsWith() function in basil.js is supposed to look.

I want to check all words of a text to see, if they start with the string 'some' (like 'sometimes', 'something', 'someone', 'somewhere' etc.).

So, I create a variable that passes on every word of my text to the b.startsWith() function.

When I put the string I am searching for in the brackets ( b.startsWith(some) ), then where exactly will I have to put the variable that will be checked if it starts with my 'some'-string?


Solution

  • There was indeed an error in our documentation. It's fixed now, thanks for letting us know.

    So you can use it as

    var trueOrFalse = b.startsWith( yourWord, yourSearchToken );