Table of contents
TOC
Collapse the table of content
Expand the table of content

Text.PositionOfAny

Owen Duncan|Last Updated: 4/19/2018

About

Returns the first occurrence of a text value in list and returns its position starting at startOffset.

Text.PositionOfAny(string as text, list as list, optional occurrence as nullable number) as number  

Arguments

ArgumentDescription
stringThe string to search for.
listThe list to search through.
optional occurrenceAn enum that controls the scope of operation.

Settings

SettingDescription
Occurrence.First or Occurrence.LastA single position is returned.
Occurrence.AllA list of positions is returned for all occurrences.

Remarks

  • If the text values are not found in the list, -1 is returned.

Examples

List.PositionOfAny("ABCD", {"B","C"}) equals 1  
List.PositionOfAny("ABCBA", {"A","B"}, Occurrence.First) equals 0  
List.PositionOfAny("ABCBA", {"A","B"}, Occurrence.Last) equals 4  
List.PositionOfAny("ABCBA", {"A","B"}, Occurrence.All) equals {0,1,3,4}  
© 2018 Microsoft