Leave feedback
  • Question

    how can i search for the exact word in an array?

Enter a new topic
  • Nour G Nour G
    0 likes 494 views

    I have been trying to search for words in an array however using the function 'findinarray' returns the index of any value 'containing' the string that I am looking for.

    I want to search for the 'exact' word inside the array. What function should I be using?

     

    Example;

    Array1[0][0] = "Internet";

    Array1[0][1] = "Stream";

    $returnIndexOfContractService = findinarray($Array1,"Str");

    -----------------------------------

    $returnIndexOfContractService --> "1"

     

    And I want $returnIndexOfContractService  to return "-1"

    Wednesday 05 July, 2017
  • Best Answer
    Andreas Hjelle Andreas Hjelle
    2 likes

    Hi,

    Did you try this: FindStringExactInArray?

    Regards,

    andreas

    Wednesday 05 July, 2017
  • Nour G Nour G
    0 likes

    Hi andreas,

    In what streamserv version can i find this function?

    Wednesday 05 July, 2017
  • Nour G Nour G
    0 likes

    Tried it and it has worked perfectly. Thanks Andreas.

    Wednesday 05 July, 2017