public String handlePart(Matcher m, String part, CellFormatType type,StringBuffer desc) {int pos = desc.length();char firstCh = part.charAt(0);switch (firstCh) {case '[':if (part.length() < 3)break;if (topmost != null)throw new IllegalArgumentException("Duplicate '[' times in format");part = part.toLowerCase(Locale.ROOT);int specLen = part.length() - 2;topmost = assignSpec(part.charAt(1), pos, specLen);return part.substring(1, 1 + specLen);case 'h':case 'm':case 's':case '0':part = part.toLowerCase(Locale.ROOT);assignSpec(part.charAt(0), pos, part.length());return part;case '\n':return "%n";case '\"':part = part.substring(1, part.length() - 1);break;case '\\':part = part.substring(1);break;case '*':if (part.length() > 1)part = CellFormatPart.expandChar(part);break;case '_':return null;}return PERCENTS.matcher(part).replaceAll("%%");}

public String HandlePart(Match m, String part, CellFormatType type,StringBuilder desc){int pos = desc.Length;char firstCh = part[0];switch (firstCh){case '[':if (part.Length < 3)break;if (_formatter.topmost != null)throw new ArgumentException("Duplicate '[' times in format");part = part.ToLower();int specLen = part.Length - 2;_formatter.topmost = _formatter.AssignSpec(part[1], pos, specLen);return part.Substring(1, specLen);case 'h':case 'm':case 's':case '0':part = part.ToLower();_formatter.AssignSpec(part[0], pos, part.Length);return part;case '\n':return "%n";case '\"':part = part.Substring(1, part.Length - 2);break;case '\\':part = part.Substring(1);break;case '*':if (part.Length > 1)part = CellFormatPart.ExpandChar(part);break;case '_':return null;}return part;}
