HashTags function
Applies to: Canvas apps Model-driven apps Power Pages
Extracts the hashtags (#strings) from a string of text.
Description
The HashTags function scans a string for hashtags. Hashtags start with a pound character (#), which is followed by any combination of:
- uppercase and lowercase letters
- numerals
- underscores
- currency symbols (such as $)
HashTags returns a one-column table that contains the hashtags in the string. If the string contains no hashtags, the function returns a one-column table that's empty.
Syntax
HashTags( String )
- String - Required. String to scan for hashtags.
Examples
Step by step
Add a Text input control, name it Tweet, and type this sentence into it:
This #app is #AMAZING and can #coUnt123 or #123abc but not #1-23 or #$*(#@")
Add a vertical custom gallery, and set its Items property to this function:
HashTags(Tweet.Text)
Add a Label control to the gallery template.
The gallery shows these hashtags:
- #app
- #AMAZING
- #coUnt123
- #123abc
- #1