Hello,
please how can I make in StimulsoftReports.Web specific format of text:
Example:
Input string: MX1025DX
Formatted output string: MX-1025-DX
Can I use ToString() or Format() function, something like ToString("##-####-##") or I need to use Substring() function?
Thank You for help.
Formatting string in a specific format
Re: Formatting string in a specific format
Hello.
You could use any C# expression to get the right string. You could use Substring() or Insert() method.
As a way you could use regular expression and write next expression:
Don't forget to add next line in the code of report:
Thank you.
You could use any C# expression to get the right string. You could use Substring() or Insert() method.
As a way you could use regular expression and write next expression:
Code: Select all
{Regex.Replace(Variable1, @"([A-Z]{2})([0-9]{4})([A-Z]{2})", "$1-$2-$3")}
Code: Select all
using System.Text.RegularExpressions;