IgnoreFieldCodes
FindReplaceOptions.IgnoreFieldCodes property
Alan kodları içindeki metnin yoksayılacağını belirten bir boole değeri alır veya ayarlar. Varsayılan değeryanlış
.
public bool IgnoreFieldCodes { get; set; }
Notlar
Bu seçenek yalnızca alan kodlarını etkiler ( arasındaki düğümleri yok saymaz)FieldSeparator veFieldEnd).
Tüm alanı yok saymak için lütfen ilgili seçeneği kullanınIgnoreFields
.
Örnekler
Alan kodlarının içindeki metnin nasıl yok sayılacağını gösterir.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertField("INCLUDETEXT", "Test IT!");
FindReplaceOptions options = new FindReplaceOptions {IgnoreFieldCodes = ignoreFieldCodes};
// Alan kodunun içindeki metni yok sayarak belgede 'T'yi değiştirin.
doc.Range.Replace(new Regex("T"), "*", options);
Console.WriteLine(doc.GetText());
Assert.AreEqual(
ignoreFieldCodes
? "\u0013INCLUDETEXT\u0014*est I*!\u0015"
: "\u0013INCLUDE*EX*\u0014*est I*!\u0015", doc.GetText().Trim());
Ayrıca bakınız
- class FindReplaceOptions
- ad alanı Aspose.Words.Replacing
- toplantı Aspose.Words