Jump to content

Align columns: Difference between revisions

No edit summary
Line 4,902:
End Sub</lang>
Usage:<lang vb>Sub Main() 'usage of the above
Const Text$ = "Given$Wa$text$file$of$many$lines,$where$fields$within$Wa$line$" & vbLf & _
"are$delineated$by$Wa$single$'dollar'$character,$write$Wa$program" & vbLf & _
"that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$" & vbLf & _
"column$are$separated$by$at$least$one$space." & vbLf & _
"Further,$allow$for$each$word$in$Wa$column$to$be$either$left$" & vbLf & _
"justified,$right$justified,$or$center$justified$within$its$column."
Line 4,914:
End Sub</lang>
Output:<pre>-- Left:
Given Wa text file of many lines, where fields within Wa line
are delineated by Wa single 'dollar' character, write Wa program
that aligns each column of fields by ensuring that words in each
column are separated by at least one space.
Further, allow for each word in Wa column to be either left
justified, right justified, or center justified within its column.
 
-- Center:
Given Wa text file of many lines, where fields within Wa line
are delineated by Wa single 'dollar' character, write Wa program
that aligns each column of fields by ensuring that words in each
column are separated by at least one space.
Further, allow for each word in Wa column to be either left
justified, right justified, or center justified within its column.
 
-- Right:
Given Wa text file of many lines, where fields within Wa line
are delineated by Wa single 'dollar' character, write Wa program
that aligns each column of fields by ensuring that words in each
column are separated by at least one space.
Further, allow for each word in Wa column to be either left
justified, right justified, or center justified within its column. </pre>
 
=={{header|Visual Basic .NET}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.