Java File Name Sanitize sanitizeFilename(String filename)

Here you can find the source of sanitizeFilename(String filename)

Description

sanitize Filename

License

Open Source License

Declaration

public static String sanitizeFilename(String filename) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String sanitizeFilename(String filename) {
        return filename.replaceAll("[^a-zA-Z0-9.-]", "_");
    }/*from  www .  j  ava  2  s  . c o  m*/
}

Related

  1. sanitize(String fileName)
  2. sanitizeBlankNodeName(String filename)
  3. sanitizeFileName(String filename)
  4. sanitizeFilename(String fileName)
  5. sanitizeFileName(String filename)
  6. sanitizeFileName(String name)
  7. sanitizeFilename(String name)