user462297
user462297

Reputation:

UWP/WinRT equivalent of NSDataDetector

I'm porting a feature from an iOS app over to a Windows 10 UWP app that requires URLs to be detected in strings (so that I can present the URL part as clickable in the view). In iOS the NSDataDetector API works great for this, but I have not found the equivalent API for a UWP app. Does such an API exist?

Thanks! -Tom B.

Upvotes: 0

Views: 81

Answers (1)

Jeffrey Chen
Jeffrey Chen

Reputation: 4680

The Window Runtime and .NET Class Library does not have such kind of API.

As I see from the document:

The NSDataDetector class is a specialized subclass of the NSRegularExpression class designed to match data detectors.

In the .NET Framework, there is a class named Regex.

Document: .NET Framework Regular Expressions

You can implement the similar functionality based on the Regex class in UWP development.

Upvotes: 1

Related Questions