Text Note list not matching

Hello, I’m trying to match the text in the TextNote.Text list, but each word in the list seems to have space below them, and I can’t get them to match.

What you’re seeing is a line break character (\n). You can either add a line break to your search term by joining strings ("GRID" + "\n") or just remove the line break from the note text with String.TrimTrailingWhitespace.

It works now. Thank you. I’m fairly new to this. May I know why this happened?

If I remember correctly, this is pretty common with TextNotes. I believe it has something to do with the internal formatting that Revit uses. It’s also very common with copy/pasted text utilizing any kind of formatting.

Other option for you to think of is the “Contains” or “StartsWIth” text nodes that could mean you do not have to worry about the trailing spaces.

Especially if you are just trying to filter out the text notes that have specific text