web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Trailing whitespaces are getting removed automatically

(1) ShareShare
ReportReport
Posted on by 6
My requirement is based on D365 F&O to add multiple additional spaces at end of string value and later I am exporting it in xml.
         
Somehow only single space is coming in the output but while debugging I can see multiple spaces getting added as per code. Even if I'm trying to add in between same is happening
 
Code snippet:
value = "Test";
paddedvalue = value + strRep(" ",10) + "*";
 
Expected Value = Test          *
Output = Test *
 
I am using visual studio 2019 to write code.
Is there any feature automatically trimming the whitespaces or I'm missing any thing ?
      
I have the same question (0)
  • Adis Profile Picture
    6,597 Super User 2026 Season 1 on at
    Hey,
     
    I am not a developer, so sorry if the suggestion is noob. However, have you tried to use Char(32) for space and Char(160) for non braking space?
     
    If you are creating a report, check if there are report properties like the following f.e.
     
     
    Kind regards, Adis
  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at
    How are you checking the result? Are you looking at the actual XML code in a text editor?
     
    I'm asking because if you use a view that displays XML in HTML, spaces are suppressed there.
  • RB-11091252-0 Profile Picture
    6 on at
    Hi Martin,
    I'm checking the output in XML and info log.
    For info log output I'm using code:
    info(paddedvalue); or info(strfmt("%1*",paddedvalue));
     
    In both outputs spaces are getting trimmed.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 465 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans