We have some scenarios to have the content inside brackets but without space between open bracket with content and closed bracket with content.
We usually do like below,
- <TextBlock x:Name="SampleTextBlock1" Height="25" Width="200" HorizontalAlignment="Center"
- VerticalAlignment="Top" Margin="15">
- <Run Text="("/>
- <Run Text="Sample Run Text with Space"/>
- <Run Text=")"/>
- </TextBlock>
The output will be ( Sample Run Text with Space ).
The spaces are there as we said above.
To remove that space, simply we need to alter the code like below.
- <TextBlock x:Name="SampleTextBlock2" Height="25" Width="200" HorizontalAlignment="Center"
- VerticalAlignment="Center" Margin="15">
- <Run Text="("/><Run Text="Sample Run Text without Space"/><Run Text=")"/>
- </TextBlock>
The output will be (Sample Run Text without Space).
Hope this simple and crazy tip helps you.