Are there compare string but more smarter way?

So for example, I have images folder, there image file name is,

some book name1
I am good book
I am best book
other different
,

and some class variables that has name variable.

Class Book{
string name;
Sprite image;
}

and I want assign image file to each book variable by comparing book’s name and image name.

Problem is, at current state, my image’s name isn’t completely same with book’s name.

But very similar at some sentence like Book1’s name is [I am good book and you?].

then this should connect with image [I am good book].

How can I do this?

It is quite difficult task. There are a lot of moments that must be considered. For your example will work String.Contains. However, it will not work in other.

book_0001_img
book_0002_img
book_0003_img
Etc

Then have have a look up table or refencence in the entity. Images and other assets are elements of an entity not the other way around. Think of it like normalizing a DB structure. Hard coding causes problems, professionaly we refer to it as ‘shame’. You manage assets, don’t let them manage you.