Extension metodlar
Extension metodlar Sarvarbek Mumtozbekov *]:mt-1 [&.highlighted:last-child]:rounded-b-md [&.highlighted:last-child>*]:mb-1 [&:only-child]:hover:ring-transparent [&.highlighted]:rounded-none [&:not(.highlighted)_+_.highlighted]:rounded-t-md [&:not(.highlighted)_+_.highlighted>*]:mt-1 [&.highlighted:has(+:not(.highlighted))]:rounded-b-md [&.highlighted:has(+:not(.highlighted))>*]:mb-1 [&:not(.highlighted)_+_.highlighted:has(+:not(.highlighted))]:rounded-md»>int i = s.DigitsCount(); Console.WriteLine(i); public static class StringExtension { public static int DigitsCount(this string str) { int x = str. Count(c => Char.IsDigit(c)); return x; } } Extension metod tuzish uchun oldin static klass yaratib olish kerak, aynan shu klassda extension … Читать далее