I need to convert the findWithinHorizon method to C#, is there anything equivalent to this?

Do you mean something like the Regex.Match() method? You intend to search a string for a pattern correct?

commented: Was looking into that. Yes, that's it. +7

I am taking input and using that in conjuction with Regex.Match("\[.*?\]", 4096));. Would that work? It works with the findWithinHorizon method in java. but getting error for c#.

That should work, assuming you wanted the second parameter to be the start point at which the pattern is matched.
Of course, in your post you have an extra ')' but I'm assuming that is a typo. What is the error?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.