DEV Community

Абдумомин
Абдумомин

Posted on

IndexOf();

IndexOf() metodi satr ichida biror belgi yoki kichik satrni qayerda uchrashini aniqlash uchun ishlatiladi> U topilgan belgining indeksni qaytaradi, agar belfini topmasa, -1 qaytaradi.

string matn = "Salom Dunyo!";
int index = matn.IndexOf('D');
int topilmadi = matn.IndexOf('z');

Shu metotda matnda biror belgini yoki so'zni qidirib, keyin u bilan keyingi amallarni bajarish kerak bo'lgnda juda foydali.

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series