Güncel C# Regex ile Metin Değiştirme (Replace)

  • Konuyu Başlatan Konuyu Başlatan Falcon
  • Başlangıç tarihi Başlangıç tarihi

Falcon

Yönetici
Kod:
using System;
using System.Text.RegularExpressions;

class Program
{
    static void Main()
    {
        string text = "Telefon numaram: 555-123-4567";
        string pattern = @"\d{3}-\d{3}-\d{4}";
       
        string replacedText = Regex.Replace(text, pattern, "***-***-****");
        Console.WriteLine(replacedText);  // Çıktı: Telefon numaram: ***-***-****
    }
}
 
Son düzenleme:
Geri
Üst