这是我的代码:
private static string AddURISlash(string remotePath)
{
if (remotePath.LastIndexOf("/") != remotePath.Length - 1)
{
remotePath += "/";
}
return remotePath;
}
Run Code Online (Sandbox Code Playgroud)
但我需要类似的东西
AddURISlash("http://foo", "bar", "baz/", "qux", "etc/");
Run Code Online (Sandbox Code Playgroud)
如果我没记错的话,string.format就是那样......
String.Format("{0}.{1}.{2}.{3} at {4}", 255, 255, 255, 0, "4 p.m.");
Run Code Online (Sandbox Code Playgroud)
C#中有什么东西允许我这样做吗?
我知道我能做到
private static string AddURISlash(string[] remotePath)
Run Code Online (Sandbox Code Playgroud)
但那不是主意.
如果这是某些框架中的某些内容可以完成而在其他框架中没有请指定以及如何解决它.
提前致谢