How to format the content with proper indentation I want 4 spaces before starting the message and next line should start where first line started for sending message to Slack

I had text in this format ( Text will vary)
738456781
This medical emergency:
45677888
46677784332
@natutry.com

While sending message message to slack
I want in this format

    738456781
    This medical emergency;
    ......

Note: This text will vary while sending this message I want these 4 or 5 or2 should be indented.I am storing this value in a string and these values are fetched from Google Sheet.
Any one has points please comment.

Thank you

Hi,

How about the following expression?

System.Text.RegularExpressions.Regex.Replace(yourString,"(?m)(?=^)","    ")

Regards,

Thanks for Response I want to send to this Slack using Api in Slack I want in this Format.
Like Bold we can use * for getting bold in slack message like that is there is any way to set them with space in ordered way.

Thank you

Hi,

As far as i know, there is no markup for space like bold.
You might be able to use > as block quote.

Regards,

Thanks for your response it’s working.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.