We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Finding the 'en space' character using aspose.words

I’ve been attempting several methods to try to find en spaces in a word document. Is this even possible? Here’s what i’ve tried:

Attempt 1:
char englishSpace = (char)8194;
string s1 = $"{englishSpace}";
var temp4 = doc1.Range.Replace(s1, “”, options);

Attempt 2
var temp3 = doc1.Range.Replace(@" ", “”, options);

Attempt 3
string UnicodeString = “\u2002”;
var tempChar = Char.Parse(UnicodeString).ToString();
var temp2 = doc1.Range.Replace(tempChar, “”, options);

Please advise.

@rniemeier I cannot reproduce the problem on my side. I generated document with en space using the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Then I used the following code to replace en space with normal space:

Document doc = new Document(@"C:\Temp\out.docx");
doc.Range.Replace("\u2002", " ");

Everything works as expected - en space is replaced with normal space.
Could you please attached your input document here for testing we will check the issue and provide you more information.

Docx files aren’t allowed in the upload function.

I’m using Aspose.Words for .NET would that make a difference?

@rniemeier I tested on Aspose.Words for .NET too. You can zip the document and attach it here.