StringExtensionsWordWrap(String, Int32, Boolean) Method
Wraps the input text into multiple lines whose words will fit into the specified line length.
Namespace: DevCase.Extensions.StringExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static string WordWrap(
string input,
int maxLength,
bool breakWords
)
Public Shared Function WordWrap (
input As String,
maxLength As Integer,
breakWords As Boolean
) As String
Dim input As String
Dim maxLength As Integer
Dim breakWords As Boolean
Dim returnValue As String
returnValue = StringExtensions.WordWrap(input,
maxLength, breakWords)
public:
static String^ WordWrap(
String^ input,
int maxLength,
bool breakWords
)
static member WordWrap :
input : string *
maxLength : int *
breakWords : bool -> string
No code example is currently available or this language may not be supported.
- input String
-
The input text.
- maxLength Int32
-
The maximum length of each line.
- breakWords Boolean
-
If True, break into multiple chunks the last word that does not fit in the end of the line,
ensuring this way that all the lines fills up to the specified maxLength line length.
String
The resulting word-wrapped string.
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 maxLength As Integer = 50
Dim breakWords As Boolean = False
Dim result As String = WordWrap(input, maxLength, breakWords)
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.