Occurrence Selection

Poor man’s manipulation to the rescue!

Where we go, we don’t need Find & Replace! 🛹⚡️

Using actions for occurrence selection is a powerful way to transform and manipulate all kinds of texts. We start by making a selection for our text. With every call to Add Selection for Next Occurrence we get another multicaret that can be moved around, insert and delete text, expand or shrink its individual selection, or toggle the casing of its text. This is exactly what we need if we have to fix only a couple of similar invocations or change the format of our data! 🎭📐

Remember to always use meaningful names! 🏷 Invoking Unselect Occurrence removes the previously added selection; Select All Occurrences scans the whole document for occurrences and selects them.

But remember: always give refactorings a try first! 🔧🤓

See Also


Related Resources

Params collection in C#
Params collection in C#
Use the params collection in C# so methods can accept a dynamic number of parameters.
Generate documentation with AI
Generate documentation with AI
AI can help you make XML documentation both automatic and useful.
File-scoped namespaces and types
File-scoped namespaces and types
Organize code better and reduce bugs by using file-scoped namespaces and objects.