namespace XGame.Framework.Utils
{
    public static class StringUtils
    {
        public static string Format(this string format, params object[] args)
        {
            if (string.IsNullOrEmpty(format))
            {
                return string.Empty;
            }
            if (args == null || args.Length <= 0)
                return format;
            else
                return string.Format(format, args);
        }

        /// <summary>
        /// 反斜杠替换为正斜杠
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static string ReplaceSlash(this string path)
        {
            return path.Replace("\\", "/");
        }
    }
}
