Çalışma kitabındaki metni Normal İfade kullanarak değiştirme
Contents
[
Hide
]
Aspose.Cells, normal bir ifade kullanarak bir çalışma kitabındaki metni değiştirme özelliği sağlar. Bunun için API şunları sağlar:normal ifade anahtarımülkiyetiSeçenekleri Değiştirsınıf. ayarlamaknormal ifade anahtarıiledoğruaranan anahtarın normal bir ifade olacağını belirtir.
Aşağıdaki kod parçacığı,normal ifade anahtarıözelliğini kullanarakörnek excel dosyası. buçıktı dosyasıaşağıdaki kod parçacığı tarafından oluşturulan referans için eklenmiştir.
Basit kod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// directories | |
String sourceDir = Utils.Get_SourceDirectory(); | |
String outputDir = Utils.Get_OutputDirectory(); | |
Workbook workbook = new Workbook(sourceDir + "SampleRegexReplace.xlsx"); | |
ReplaceOptions replace = new ReplaceOptions(); | |
replace.setCaseSensitive(false); | |
replace.setMatchEntireCellContents(false); | |
// Set to true to indicate that the searched key is regex | |
replace.setRegexKey(true); | |
workbook.replace("\\bKIM\\b", "^^^TIM^^^", replace); | |
workbook.save(outputDir + "RegexReplace_out.xlsx"); |