Ok I haven’t posted here in ages but I’m really stuck.
I’m from Germany and this thread’s title is probably misleading because I’m having a hard time naming my problem. What I want to do is:
I generate an about 6 digits long number. For example 242640. Now what I want to do is: I want to know if this int contains, for example, a 2. Which it does twice. 151650 for example does not contain a 2 obviously.

The idea is to do something like if(IntName has a 2 in it) Do stuff.
Has anyone an idea how to do this or how to google for a solution?
Thanks in advance!

I googled “algorithm to check if number contains a particular decimal digit” and found this, which contains C# examples for two effective approaches to the problem: