P
P
Paulskit2012-05-25 13:48:13
.NET
Paulskit, 2012-05-25 13:48:13

String comparison in C#?

Faced such task. For example. There is a "hello" line. It is necessary that the lines are considered the same, even if there are English letters in one line (a, e, etc.). InvariantCulture didn't help. Are there simple solutions?

Answer the question

In order to leave comments, you need to log in

10 answer(s)
S
Shedal, 2012-05-25
@Paulskit

Standard .NET tools will not be able to do this automatically. After all, the characters are different, even if they look similar.
A simple option is to first replace all English characters with similar Russian ones, and then compare the strings.

K
kastaneda, 2012-05-25
@kastaneda

text.ToLower() to image and compare pictures

D
Dmitry, 2012-05-25
@Neir0

You need to translate the text into a picture, then either upload it to antigate (a service for captcha recognition), or use a text recognition engine (I recommend tesseract, there are examples with EmguCV - a wrapper for OpenCV in c#)

S
sha1dy, 2012-05-25
@sha1dy

sorry, but this question attracted so many inadequate :)

E
EugeneOZ, 2012-05-25
@EugeneOZ

Convert both strings to lower case ( .ToLower() )

I
III, 2012-05-25
@ III

usanov.net/748-transliteraciya-rus-2-lat-na-c

I
III, 2012-05-25
@ III

unidecode.codeplex.com/

E
Error_403_Forbidden, 2012-11-13
@Error_403_Forbidden

Here is habrahabr.ru/post/86303/

A
agasper, 2012-05-25
@agasper

There is no standard solution. Either write a method to compare strings, or inherit from the String class and override the Equals method

J
jonie, 2012-05-28
@jonie

But in general, you can read fuzzy logic and take a measure of hamming, for example ... yes, thousands of these measures - for any taste, in general.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question