楼主说的是占位符 C#中有 string.Format可以达到效果,这个方法有好多个版本的重载,下面只是其中一个,仅供参考。// // Summary: // Replaces the format item in a specified string with the string representation // of a corresponding object in a specified array. // // Parameters: // format: // A composite format string. // // args: // An object array that contains zero or more objects to format. // // Returns: // A copy of format in which the format items have been replaced by the string // representation of the corresponding objects in args. // // Exceptions: // System.ArgumentNullException: // format or args is null. // // System.FormatException: // format is invalid.-or- The index of a format item is less than zero, or greater // than or equal to the length of the args array. public static string Format(string format, params object[] args);
可以这样argarray=argarray.Select(a=>String.Formate("{0}%",a)).ToArray();
C#中有 string.Format可以达到效果,这个方法有好多个版本的重载,下面只是其中一个,仅供参考。//
// Summary:
// Replaces the format item in a specified string with the string representation
// of a corresponding object in a specified array.
//
// Parameters:
// format:
// A composite format string.
//
// args:
// An object array that contains zero or more objects to format.
//
// Returns:
// A copy of format in which the format items have been replaced by the string
// representation of the corresponding objects in args.
//
// Exceptions:
// System.ArgumentNullException:
// format or args is null.
//
// System.FormatException:
// format is invalid.-or- The index of a format item is less than zero, or greater
// than or equal to the length of the args array.
public static string Format(string format, params object[] args);