public static String pathToString(String[] path, int length) {if (length == 0) {return "";}StringBuilder sb = new StringBuilder();for(int i=0;i<length;i++) {String s = path[i];if (s.length() == 0) {throw new IllegalArgumentException("each path component must have length > 0 (got: \"\")");}int numChars = s.length();for(int j=0;j<numChars;j++) {char ch = s.charAt(j);if (ch == DELIM_CHAR || ch == ESCAPE_CHAR) {sb.append(ESCAPE_CHAR);}sb.append(ch);}sb.append(DELIM_CHAR);}sb.setLength(sb.length()-1);return sb.toString();}
public static string PathToString(string[] path, int length){if (length == 0){return "";}StringBuilder sb = new StringBuilder();for (int i = 0; i < length; i++){string s = path[i];if (s.Length == 0){throw new System.ArgumentException("each path component must have length > 0 (got: \"\")");}int numChars = s.Length;for (int j = 0; j < numChars; j++){char ch = s[j];if (ch == DELIM_CHAR || ch == ESCAPE_CHAR){sb.Append(ESCAPE_CHAR);}sb.Append(ch);}sb.Append(DELIM_CHAR);}sb.Length = sb.Length - 1;return sb.ToString();}