public static String segmentFileName(String segmentName, String segmentSuffix, String ext) {if (ext.length() > 0 || segmentSuffix.length() > 0) {assert !ext.startsWith(".");StringBuilder sb = new StringBuilder(segmentName.length() + 2 + segmentSuffix.length() + ext.length());sb.append(segmentName);if (segmentSuffix.length() > 0) {sb.append('_').append(segmentSuffix);}if (ext.length() > 0) {sb.append('.').append(ext);}return sb.toString();} else {return segmentName;}}

public static String segmentFileName ( String segmentName , String segmentSuffix , String ext ) { if ( ext . length ( ) > 0 || segmentSuffix . length ( ) > 0 ) { assert ! ext . startsWith ( "." ) ; StringBuilder sb = new StringBuilder ( segmentName . length ( ) + 2 + segmentSuffix . length ( ) + ext . length ( ) ) ; sb . append ( segmentName ) ; if ( segmentSuffix . length ( ) > 0 ) { sb . append ( '_' ) . append ( segmentSuffix ) ; } if ( ext . length ( ) > 0 ) { sb . append ( '.' ) . append ( ext ) ; } return sb . toString ( ) ; } else { return segmentName ; } }
public static string SegmentFileName(string segmentName, string segmentSuffix, string ext){if (ext.Length > 0 || segmentSuffix.Length > 0){Debug.Assert(!ext.StartsWith(".", StringComparison.Ordinal));StringBuilder sb = new StringBuilder(segmentName.Length + 2 + segmentSuffix.Length + ext.Length);sb.Append(segmentName);if (segmentSuffix.Length > 0){sb.Append('_').Append(segmentSuffix);}if (ext.Length > 0){sb.Append('.').Append(ext);}return sb.ToString();}else{return segmentName;}}
