Is there any way to assign Array String to method java.lang.String.endwith(String suffix) -


I need an array list with the suffix of a file like

  string [ ] FileType = {"PDF", "MP3", "JPG"} File Source FileTok -Type = New File ("C: \\ User \\ RS \\ Desktop \\ test.pdf");   

Using the method below .... This method is full of errors to deal with such a situation

  Public Stable Boolean File Type (file source filetokcap, string [] fileType) {for (string filetype: fileType) return source fileTok type.gateName (). EndsWith ("." + FiletypeS); }    

You're almost done Try this code:

  Public Static Boolean file type acceptance (file source, string [] fileTypes) {for (string file type: file type) if (source.getAbsolutePath (.) EndsWith ("." + Filetype)) true back; return false; }    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -