public static int getNoOnly(String text)
foreach (char c in text.ToCharArray())
if ((c == '0') || (c == '1') || (c == '2') || (c == '3') || (c == '4') || (c == '5') || (c == '6') || (c == '7') || (c == '8') || (c == '9'))
if (NewText == "") {NewText = "0";}
int NewInt = Convert.ToInt32(NewText);
public static void Main()
Console.WriteLine(getNoOnly("بيل0بيلبيلبيل5يبليب6بيلي3بيلبي3يبلبي0بيليب9بيلبي6يبلبي2ليببيبيلليبل8"));