Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7627443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:27:37+00:00 2026-05-31T05:27:37+00:00

I need a string that I can use for page header. The problem is

  • 0

I need a string that I can use for page header. The problem is when i use vbcrlf then i don’t know how to come back up and write.
Example:

dim MyStr As String = "Amount to be" & vbcrlf & "Deducted in This Month" & VbCrLf

MyStr &= "Amount Paid Last" & VbCrLf & "Month" & VbCrLf

This Gives me Output

Amount to be
Deducted in This Month
Amount Paid Last
Month

‘—I Want the Output like this

Amount to be                               Amount Paid Last
Deducted in This Month                     Month

‘Please help me to findout the solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:27:37+00:00Added an answer on May 31, 2026 at 5:27 am

    You should always use composite formatting in a case like this. Be sure to read up on it in the MSDN Library. A key feature to take advantage of here is its ability to align the text and pad it with spaces. The format specifier should look like {n,w:c} where n is the argument number, w is the width of the generated string and c is the desired format. Use a negative value for w to align the text to the left.

    So code like this:

        Dim ToBePaid As Decimal = 1.23
        Dim Deducted As Decimal = 0.04
        Dim PaidLast As Decimal = 2.45
        Dim PayDate As DateTime = DateTime.Now
        Dim MyStr = String.Format("{0,-10:C}{1,20:C}", ToBePaid, PaidLast) + vbCrLf + _
                    String.Format("{0,-10:C}{1,20:MMMM}", Deducted, PayDate)
        Console.WriteLine(MyStr)
    

    Produces this output:

    $1.23                    $2.45
    $0.04                    March
    

    It will only look properly aligned if you look at the file with a file viewer that uses a fixed-pitch font.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I get some part of string that I need? accountid=xxxxxx type=prem servertime=1256876305
I have the follow string that I need to parse, and then run it
I need a PHP Regex that can parse .strings files. In particular, it needs
I need to clean a string that comes (copy/pasted) from various Microsoft Office suite
I have a string that I need to convert to the equivalent array of
I need to parse out the string that has following structure x:{a,b,c,}, y:{d,e,f} etc.
I need a function to return a string that will only be accessed read-only.
I need to break apart a string that always looks like this: something --
Say i have a string that i need to evaluate in javascript such as
I need an simple way to check whether a string that is sent to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.