UtilStringJustifyText Method
Justifies the input text by adjusting the line width and spacing between words.
Namespace: DevCase.Core.DataProcessing.CommonAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static string JustifyText(
string input,
int length,
bool justifyLastLine = false
)
Public Shared Function JustifyText (
input As String,
length As Integer,
Optional justifyLastLine As Boolean = false
) As String
Dim input As String
Dim length As Integer
Dim justifyLastLine As Boolean
Dim returnValue As String
returnValue = UtilString.JustifyText(input,
length, justifyLastLine)
public:
static String^ JustifyText(
String^ input,
int length,
bool justifyLastLine = false
)
static member JustifyText :
input : string *
length : int *
?justifyLastLine : bool
(* Defaults:
let _justifyLastLine = defaultArg justifyLastLine false
*)
-> string
No code example is currently available or this language may not be supported.
- input String
-
The input text.
- length Int32
-
The desired length for each text line.
- justifyLastLine Boolean (Optional)
-
Optional. Indicates whether to justify the last line of the paragraphs.
Default value is: False.
String
The resulting justified text.
This is a code example.
No code example is currently available or this language may not be supported.
Dim input As String =
"About 20% of oxygen is produced by the Amazon rainforest. The Earth's atmosphere is about 78 percent nitrogen, 21 percent oxygen, and about 1 percent other gases.
For the existence of most organisms on the planet, oxygen is a necessary element, it provides the body with energy and removes carbon dioxide. Fortunately, plants constantly replenish the oxygen level of our planet thanks to photosynthesis. During this process, carbon dioxide and water are converted into energy, releasing oxygen as a byproduct.
The Amazon rainforest covers 5.5 million square kilometers (2.1 million square miles), recycling much of the Earth's oxygen while absorbing large amounts of carbon dioxide."
Dim lineLength As Integer = 50
Dim result As String = JustifyText(input, lineLength, justifyLastLine:=True)
Console.WriteLine(result)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.