Extensions.AddAfter Method (String, String, Int32, Int32)

<< >>

Navigation:  CodeStencil > Custom Library > Class Library > Expansion Namespace > Extensions Class > Extensions Methods > AddAfter Method  >

Extensions.AddAfter Method (String, String, Int32, Int32)

Adds character(s) after the string depending whether it is the last element output from a loop. For example when you want to add comma while listing items in a ForEach or For loop

Namespace: ZeraSystems.CodeNanite.Expansion

Assembly:  ZeraSystems.CodeNanite.Expansion (in ZeraSystems.CodeNanite.Expansion.dll)

Syntax


C#

public static string AddAfter(
 string str,
 string text,
 int index,
 int count
)

Parameters

str

Type: String

The string to be updated

text

Type: String

The character of string to be added after the passed string

index

Type: Int32

The index of the current element. Remember to ADD 1 for 0-based lists/elements

count

Type: Int32

The total number of elements

Return Value

System.String.

See Also


Extensions Class

AddAfter Overload

ZeraSystems.CodeNanite.Expansion Namespace