Condividi tramite


CommandLineBuilder.AppendFileNamesIfNotNull Method (array<String , String)

Appends the command line with the list of file names in the specified string array, separated by the specified delimiter.

MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.

Namespace:  Microsoft.Build.Utilities
Assembly:  Microsoft.Build.Utilities.Core (in Microsoft.Build.Utilities.Core.dll)

Syntax

'Declaration
Public Sub AppendFileNamesIfNotNull ( _
    fileNames As String(), _
    delimiter As String _
)
public void AppendFileNamesIfNotNull(
    string[] fileNames,
    string delimiter
)
public:
void AppendFileNamesIfNotNull(
    array<String^>^ fileNames, 
    String^ delimiter
)
member AppendFileNamesIfNotNull : 
        fileNames:string[] * 
        delimiter:string -> unit
public function AppendFileNamesIfNotNull(
    fileNames : String[], 
    delimiter : String
)

Parameters

  • fileNames
    Type: array<System.String[]

    The file names to append. If the array is nulla null reference (Nothing in Visual Basic), then this method has no effect.

  • delimiter
    Type: System.String

    The delimiter to put between file names in the command line.

Remarks

This method appends the command line with file names, and surrounds the file names with quotation marks as necessary. The file names are separated by the specified delimiter.

If the command line is not empty, then this method also appends the command line with a space, before the file names.

Examples

AppendFileNamesIfNotNull(new string[] {"Alpha.cs", "Beta.cs"}, ",") yields Alpha.cs,Beta.cs.

.NET Framework Security

See Also

Reference

CommandLineBuilder Class

AppendFileNamesIfNotNull Overload

Microsoft.Build.Utilities Namespace