Path.Combine

2017-05-30 13:39:19  访问(1371) 赞(0) 踩(0)

  • 
          
            /// <summary>
            /// Path.Combine(string strOne, string strTwo)
            /// </summary>
            /// <param name="strOne"></param>
            /// <param name="strTwo"></param>
            /// <returns></returns>
            public string PathCombine(string strOne, string strTwo)
            {
                return Path.Combine(strOne, strTwo);
            }
    

  • 输入1:
    输入2:
    输出:
  • // 要注意前后的斜杠符
    Path.Combine("canoer\\", "fsdfds") = "canoer\\fsdfds";
    
    Path.Combine("one", "two") = "one\two";
    
    Path.Combine("one", "/two") = "/two";
    

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)