@@ -195,7 +195,7 @@ static string InterpretExternalAttributes(int operatingSystem, int attributes)
195195 static bool IsNumeric ( string rhs )
196196 {
197197 bool result ;
198- if ( ( rhs != null ) && ( rhs . Length > 0 ) ) {
198+ if ( ! string . IsNullOrEmpty ( rhs ) ) {
199199 result = true ;
200200 for ( int i = 0 ; result && ( i < rhs . Length ) ; ++ i ) {
201201 if ( ! char . IsDigit ( rhs [ i ] ) ) {
@@ -614,7 +614,7 @@ void ListZip(string fileName) {
614614
615615 using ( FileStream fileStream = File . OpenRead ( fileName ) ) {
616616 using ( ZipInputStream stream = new ZipInputStream ( fileStream ) ) {
617- if ( ( password != null ) && ( password . Length > 0 ) ) {
617+ if ( ! string . IsNullOrEmpty ( password ) ) {
618618 stream . Password = password ;
619619 }
620620
@@ -756,7 +756,7 @@ void List(ArrayList fileSpecifications)
756756 string [ ] names ;
757757 string pathName = Path . GetDirectoryName ( spec ) ;
758758
759- if ( ( pathName == null ) || ( pathName . Length == 0 ) ) {
759+ if ( string . IsNullOrEmpty ( pathName ) ) {
760760 pathName = @".\" ;
761761 }
762762 names = Directory . GetFiles ( pathName , Path . GetFileName ( spec ) ) ;
@@ -792,7 +792,7 @@ static public string CookZipEntryName(string name, string stripPrefix, bool rela
792792 return "" ;
793793 }
794794
795- if ( stripPrefix != null && stripPrefix . Length > 0 && name . IndexOf ( stripPrefix , 0 ) == 0 ) {
795+ if ( ! string . IsNullOrEmpty ( stripPrefix ) && name . IndexOf ( stripPrefix , 0 ) == 0 ) {
796796 name = name . Substring ( stripPrefix . Length ) ;
797797 }
798798
@@ -963,7 +963,7 @@ void Create(ArrayList fileSpecifications)
963963
964964 using ( FileStream stream = File . Create ( zipFileName ) ) {
965965 using ( outputStream = new ZipOutputStream ( stream ) ) {
966- if ( ( password != null ) && ( password . Length > 0 ) ) {
966+ if ( ! string . IsNullOrEmpty ( password ) ) {
967967 outputStream . Password = password ;
968968 }
969969
@@ -973,7 +973,7 @@ void Create(ArrayList fileSpecifications)
973973 string fileName = Path . GetFileName ( spec ) ;
974974 string pathName = Path . GetDirectoryName ( spec ) ;
975975
976- if ( pathName == null || pathName . Length == 0 ) {
976+ if ( string . IsNullOrEmpty ( pathName ) ) {
977977 pathName = Path . GetFullPath ( "." ) ;
978978 if ( relativePathInfo == true ) {
979979 removablePathPrefix = pathName ;
@@ -1132,7 +1132,7 @@ bool DecompressFile(string fileName, string targetDir)
11321132 /// </summary>
11331133 void Extract ( ArrayList fileSpecifications )
11341134 {
1135- if ( targetOutputDirectory == null || targetOutputDirectory . Length == 0 ) {
1135+ if ( string . IsNullOrEmpty ( targetOutputDirectory ) ) {
11361136 targetOutputDirectory = @".\" ;
11371137 }
11381138
@@ -1142,7 +1142,7 @@ void Extract(ArrayList fileSpecifications)
11421142 if ( spec . IndexOf ( '*' ) >= 0 || spec . IndexOf ( '?' ) >= 0 ) {
11431143 string pathName = Path . GetDirectoryName ( spec ) ;
11441144
1145- if ( pathName == null || pathName . Length == 0 ) {
1145+ if ( string . IsNullOrEmpty ( pathName ) ) {
11461146 pathName = @".\" ;
11471147 }
11481148 names = Directory . GetFiles ( pathName , Path . GetFileName ( spec ) ) ;
0 commit comments