手机迅雷保存下载视频的位置选的是的外置内存卡,视频下好了,我却卡刷找不到外置sd卡...........

首先内部存储路径为/data/data/youPackageName/,下面讲解的各路径都是基于你自己的应用的内部存储路径下。所有内部存储中保存的文件在用户卸载应用的时候会被删除。
一、&files
1. Context.getFilesDir(),该方法返回/data/data/youPackageName/files的File对象。
2. Context.openFileInput()与Context.openFileOutput(),只能读取和写入files下的文件,返回的是FileInputStream和FileOutputStream对象。
3. Context.fileList(),返回files下所有的文件名,返回的是String[]对象。
4. Context.deleteFile(String),删除files下指定名称的文件。
1. Context.getCacheDir(),该方法返回/data/data/youPackageName/cache的File对象。
三、custom dir
getDir(String name,&int mode),返回/data/data/youPackageName/下的指定名称的文件夹File对象,如果该文件夹不存在则用指定名称创建一个新的文件夹
//&&获取当前程序路径
&&&&getApplicationContext().getFilesDir().getAbsolutePath();
// &获取该程序的安装包路径
&&&&String
path=getApplicationContext().getPackageResourcePath();
// &获取程序默认数据库路径
&&&&getApplicationContext().getDatabasePath(s).getAbsolutePath();
//===============================================
================================================
获取手机中外置内存卡、内置内存卡、手机内存路径。思路是:先用 Environment.getExternalStorageDirectory()获得外部存储卡路径(某些机型也表现为内部存储卡路径),如没有获 取到有效sd卡插入,则使用安卓的配置文件system/etc/vold.fstab读取全部挂载信息,假如也没有可写入的sd卡,则使用
getFilesDir()方式获得当前应用所在存储路径。为适应不同手机的内存情况,先分三种情况获得可存储路径phonePicsPath,后面代码较长是因为有两个工具类,复制即可,代码如下:
//首先判断是否有外部存储卡,如没有判断是否有内部存储卡,如没有,继续读取应用程序所在存储
if(getExternalSdCardPath() != null){
phonePicsPath = getExternalSdCardPath();
phonePicsPath = getFilesDir().getAbsolutePath();
& & &* 遍历 &system/etc/vold.fstab” 文件,获取全部的Android的挂载点信息
& & &* @return
& & private static ArrayList&String& getDevMountList() {
& & & & String[] toSearch = FileUtils.readFile(&/system/etc/vold.fstab&).split(& &);
& & & & ArrayList&String& out = new ArrayList&String&();
& & & & for (int i = 0; i & toSearch. i++) {
& & & & & & if (toSearch[i].contains(&dev_mount&)) {
& & & & & & & & if (new File(toSearch[i + 2]).exists()) {
& & & & & & & & & & out.add(toSearch[i + 2]);
& & & & & & & & }
& & & & & & }
* 获取扩展SD卡存储目录
* 如果有外接的SD卡,并且已挂载,则返回这个外置SD卡目录
* 否则:返回内置SD卡目录
public static String getExternalSdCardPath() {
if (SDCardUtils.isMounted()) {
File sdCardFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath());
return sdCardFile.getAbsolutePath();
String path =
File sdCardFile =
ArrayList&String& devMountList = getDevMountList();
for (String devMount : devMountList) {
File file = new File(devMount);
if (file.isDirectory() && file.canWrite()) {
path = file.getAbsolutePath();
String timeStamp = new SimpleDateFormat(&ddMMyyyy_HHmmss&).format(new Date());
File testWritable = new File(path, &test_& + timeStamp);
if (testWritable.mkdirs()) {
testWritable.delete();
if (path != null) {
sdCardFile = new File(path);
return sdCardFile.getAbsolutePath();
FileUtils文件:
package com.zqsy.order.
* 文件工具类
* @author zhangda
import java.io.BufferedR
import java.io.F
import java.io.FileInputS
import java.io.FileNotFoundE
import java.io.FileOutputS
import java.io.FileW
import java.io.IOE
import java.io.InputS
import java.io.InputStreamR
import java.io.OutputS
import java.util.ArrayL
import java.util.L
import android.text.TextU
* File Utils
* Read or write file
* &li&{@link #readFile(String)} read file&/li&
* &li&{@link #readFileToList(String)} read file to string list&/li&
* &li&{@link #writeFile(String, String, boolean)} write file from String&/li&
* &li&{@link #writeFile(String, String)} write file from String&/li&
* &li&{@link #writeFile(String, List, boolean)} write file from String List&/li&
* &li&{@link #writeFile(String, List)} write file from String List&/li&
* &li&{@link #writeFile(String, InputStream)} write file&/li&
* &li&{@link #writeFile(String, InputStream, boolean)} write file&/li&
* &li&{@link #writeFile(File, InputStream)} write file&/li&
* &li&{@link #writeFile(File, InputStream, boolean)} write file&/li&
* Operate file
* &li&{@link #moveFile(File, File)} or {@link #moveFile(String, String)}&/li&
* &li&{@link #copyFile(String, String)}&/li&
* &li&{@link #getFileExtension(String)}&/li&
* &li&{@link #getFileName(String)}&/li&
* &li&{@link #getFileNameWithoutExtension(String)}&/li&
* &li&{@link #getFileSize(String)}&/li&
* &li&{@link #deleteFile(String)}&/li&
* &li&{@link #isFileExist(String)}&/li&
* &li&{@link #isFolderExist(String)}&/li&
* &li&{@link #makeFolders(String)}&/li&
* &li&{@link #makeDirs(String)}&/li&
* @author &a href=&& target=&_blank&&Trinea&/a&
public class FileUtils {
public final static String FILE_EXTENSION_SEPARATOR = &.&;
private FileUtils() {
throw new AssertionError();
* read file
* @param filePath
* @param charsetName The name of a supported {@link java.nio.charset.Charset &/code&charset&code&}
* @return if file not exist, return null, else return content of file
* @throws RuntimeException if an error occurs while operator BufferedReader
public static String readFile(String filePath) {
String fileContent = &&;
File file = new File(filePath);
if (file == null || !file.isFile()) {
BufferedReader reader =
InputStreamReader is = new InputStreamReader(new FileInputStream(file));
reader = new BufferedReader(is);
String line =
int i = 0;
while ((line = reader.readLine()) != null) {
fileContent += line + & &;
reader.close();
return fileC
} catch (IOException e) {
e.printStackTrace();
} finally {
if (reader != null) {
reader.close();
} catch (IOException e) {
e.printStackTrace();
return fileC
* write file
* @param filePath
* @param content
* @param append is append, if true, write to the end of file, else clear content of file and write into it
* @return return false if content is empty, true otherwise
* @throws RuntimeException if an error occurs while operator FileWriter
public static boolean writeFile(String filePath, String content, boolean append) {
if (StringUtils.isEmpty(content)) {
FileWriter fileWriter =
makeDirs(filePath);
fileWriter = new FileWriter(filePath, append);
fileWriter.write(content);
fileWriter.close();
} catch (IOException e) {
throw new RuntimeException(&IOException occurred. &, e);
} finally {
if (fileWriter != null) {
fileWriter.close();
} catch (IOException e) {
throw new RuntimeException(&IOException occurred. &, e);
* write file
* @param filePath
* @param contentList
* @param append is append, if true, write to the end of file, else clear content of file and write into it
* @return return false if contentList is empty, true otherwise
* @throws RuntimeException if an error occurs while operator FileWriter
public static boolean writeFile(String filePath, List&String& contentList, boolean append) {
if (contentList == null || contentList.size() == 0) {
FileWriter fileWriter =
makeDirs(filePath);
fileWriter = new FileWriter(filePath, append);
int i = 0;
for (String line : contentList) {
if (i++ & 0) {
fileWriter.write(&\r\n&);
fileWriter.write(line);
fileWriter.close();
} catch (IOException e) {
throw new RuntimeException(&IOException occurred. &, e);
} finally {
if (fileWriter != null) {
fileWriter.close();
} catch (IOException e) {
throw new RuntimeException(&IOException occurred. &, e);
* write file, the string will be written to the begin of the file
* @param filePath
* @param content
public static boolean writeFile(String filePath, String content) {
return writeFile(filePath, content, false);
* write file, the string list will be written to the begin of the file
* @param filePath
* @param contentList
public static boolean writeFile(String filePath, List&String& contentList) {
return writeFile(filePath, contentList, false);
* write file, the bytes will be written to the begin of the file
* @param filePath
* @param stream
* @see {@link #writeFile(String, InputStream, boolean)}
public static boolean writeFile(String filePath, InputStream stream) {
return writeFile(filePath, stream, false);
* write file
* @param file the file to be opened for writing.
* @param stream the input stream
* @param append if &code&true&/code&, then bytes will be written to the end of the file rather than the beginning
* @return return true
* @throws RuntimeException if an error occurs while operator FileOutputStream
public static boolean writeFile(String filePath, InputStream stream, boolean append) {
return writeFile(filePath != null ? new File(filePath) : null, stream, append);
* write file, the bytes will be written to the begin of the file
* @param file
* @param stream
* @see {@link #writeFile(File, InputStream, boolean)}
public static boolean writeFile(File file, InputStream stream) {
return writeFile(file, stream, false);
* write file
* @param file the file to be opened for writing.
* @param stream the input stream
* @param append if &code&true&/code&, then bytes will be written to the end of the file rather than the beginning
* @return return true
* @throws RuntimeException if an error occurs while operator FileOutputStream
public static boolean writeFile(File file, InputStream stream, boolean append) {
OutputStream o =
makeDirs(file.getAbsolutePath());
o = new FileOutputStream(file, append);
byte data[] = new byte[1024];
int length = -1;
while ((length = stream.read(data)) != -1) {
o.write(data, 0, length);
o.flush();
} catch (FileNotFoundException e) {
throw new RuntimeException(&FileNotFoundException occurred. &, e);
} catch (IOException e) {
throw new RuntimeException(&IOException occurred. &, e);
} finally {
if (o != null) {
o.close();
stream.close();
} catch (IOException e) {
throw new RuntimeException(&IOException occurred. &, e);
* move file
* @param sourceFilePath
* @param destFilePath
public static void moveFile(String sourceFilePath, String destFilePath) {
if (TextUtils.isEmpty(sourceFilePath) || TextUtils.isEmpty(destFilePath)) {
throw new RuntimeException(&Both sourceFilePath and destFilePath cannot be null.&);
moveFile(new File(sourceFilePath), new File(destFilePath));
* move file
* @param srcFile
* @param destFile
public static void moveFile(File srcFile, File destFile) {
boolean rename = srcFile.renameTo(destFile);
if (!rename) {
copyFile(srcFile.getAbsolutePath(), destFile.getAbsolutePath());
deleteFile(srcFile.getAbsolutePath());
* copy file
* @param sourceFilePath
* @param destFilePath
* @throws RuntimeException if an error occurs while operator FileOutputStream
public static boolean copyFile(String sourceFilePath, String destFilePath) {
InputStream inputStream =
inputStream = new FileInputStream(sourceFilePath);
} catch (FileNotFoundException e) {
throw new RuntimeException(&FileNotFoundException occurred. &, e);
return writeFile(destFilePath, inputStream);
* read file to string list, a element of list is a line
* @param filePath
* @param charsetName The name of a supported {@link java.nio.charset.Charset &/code&charset&code&}
* @return if file not exist, return null, else return content of file
* @throws RuntimeException if an error occurs while operator BufferedReader
public static List&String& readFileToList(String filePath, String charsetName) {
File file = new File(filePath);
List&String& fileContent = new ArrayList&String&();
if (file == null || !file.isFile()) {
BufferedReader reader =
InputStreamReader is = new InputStreamReader(new FileInputStream(file), charsetName);
reader = new BufferedReader(is);
String line =
while ((line = reader.readLine()) != null) {
fileContent.add(line);
reader.close();
return fileC
} catch (IOException e) {
throw new RuntimeException(&IOException occurred. &, e);
} finally {
if (reader != null) {
reader.close();
} catch (IOException e) {
throw new RuntimeException(&IOException occurred. &, e);
* get file name from path, not include suffix
getFileNameWithoutExtension(null)
getFileNameWithoutExtension(&&)
getFileNameWithoutExtension(&
getFileNameWithoutExtension(&abc&)
getFileNameWithoutExtension(&a.mp3&)
getFileNameWithoutExtension(&a.b.rmvb&)
getFileNameWithoutExtension(&c:\\&)
getFileNameWithoutExtension(&c:\\a&)
getFileNameWithoutExtension(&c:\\a.b&)
getFileNameWithoutExtension(&c:a.txt\\a&)
getFileNameWithoutExtension(&/home/admin&)
getFileNameWithoutExtension(&/home/admin/a.txt/b.mp3&)
* @param filePath
* @return file name from path, not include suffix
public static String getFileNameWithoutExtension(String filePath) {
if (StringUtils.isEmpty(filePath)) {
return fileP
int extenPosi = filePath.lastIndexOf(FILE_EXTENSION_SEPARATOR);
int filePosi = filePath.lastIndexOf(File.separator);
if (filePosi == -1) {
return (extenPosi == -1 ? filePath : filePath.substring(0, extenPosi));
if (extenPosi == -1) {
return filePath.substring(filePosi + 1);
return (filePosi & extenPosi ? filePath.substring(filePosi + 1, extenPosi) : filePath.substring(filePosi + 1));
* get file name from path, include suffix
getFileName(null)
getFileName(&&)
getFileName(&
getFileName(&a.mp3&)
getFileName(&a.b.rmvb&)
&a.b.rmvb&
getFileName(&abc&)
getFileName(&c:\\&)
getFileName(&c:\\a&)
getFileName(&c:\\a.b&)
getFileName(&c:a.txt\\a&)
getFileName(&/home/admin&)
getFileName(&/home/admin/a.txt/b.mp3&)
* @param filePath
* @return file name from path, include suffix
public static String getFileName(String filePath) {
if (StringUtils.isEmpty(filePath)) {
return fileP
int filePosi = filePath.lastIndexOf(File.separator);
return (filePosi == -1) ? filePath : filePath.substring(filePosi + 1);
* get folder name from path
getFolderName(null)
getFolderName(&&)
getFolderName(&
getFolderName(&a.mp3&)
getFolderName(&a.b.rmvb&)
getFolderName(&abc&)
getFolderName(&c:\\&)
getFolderName(&c:\\a&)
getFolderName(&c:\\a.b&)
getFolderName(&c:a.txt\\a&)
getFolderName(&c:a\\b\\c\\d.txt&)
&c:a\\b\\c&
getFolderName(&/home/admin&)
getFolderName(&/home/admin/a.txt/b.mp3&)
&/home/admin/a.txt&
* @param filePath
public static String getFolderName(String filePath) {
if (StringUtils.isEmpty(filePath)) {
return fileP
int filePosi = filePath.lastIndexOf(File.separator);
return (filePosi == -1) ? && : filePath.substring(0, filePosi);
* get suffix of file from path
getFileExtension(null)
getFileExtension(&&)
getFileExtension(&
getFileExtension(&a.mp3&)
getFileExtension(&a.b.rmvb&)
getFileExtension(&abc&)
getFileExtension(&c:\\&)
getFileExtension(&c:\\a&)
getFileExtension(&c:\\a.b&)
getFileExtension(&c:a.txt\\a&)
getFileExtension(&/home/admin&)
getFileExtension(&/home/admin/a.txt/b&)
getFileExtension(&/home/admin/a.txt/b.mp3&)
* @param filePath
public static String getFileExtension(String filePath) {
if (StringUtils.isBlank(filePath)) {
return fileP
int extenPosi = filePath.lastIndexOf(FILE_EXTENSION_SEPARATOR);
int filePosi = filePath.lastIndexOf(File.separator);
if (extenPosi == -1) {
return &&;
return (filePosi &= extenPosi) ? && : filePath.substring(extenPosi + 1);
* Creates the directory named by the trailing filename of this file, including the complete directory path required
* to create this directory. &br/&
* &strong&Attentions:&/strong&
* &li&makeDirs(&C:\\Users\\Trinea&) can only create users folder&/li&
* &li&makeFolder(&C:\\Users\\Trinea\\&) can create Trinea folder&/li&
* @param filePath
* @return true if the necessary directories have been created or the target directory already exists, false one of
the directories can not be created.
&li&if {@link FileUtils#getFolderName(String)} return null, return false&/li&
&li&if target directory already exists, return true&/li&
&li&return {@link java.io.File#makeFolder}&/li&
public static boolean makeDirs(String filePath) {
String folderName = getFolderName(filePath);
if (StringUtils.isEmpty(folderName)) {
File folder = new File(folderName);
return (folder.exists() && folder.isDirectory()) ? true : folder.mkdirs();
* @param filePath
* @see #makeDirs(String)
public static boolean makeFolders(String filePath) {
return makeDirs(filePath);
* Indicates if this file represents a file on the underlying file system.
* @param filePath
public static boolean isFileExist(String filePath) {
if (StringUtils.isBlank(filePath)) {
File file = new File(filePath);
return (file.exists() && file.isFile());
* Indicates if this file represents a directory on the underlying file system.
* @param directoryPath
public static boolean isFolderExist(String directoryPath) {
if (StringUtils.isBlank(directoryPath)) {
File dire = new File(directoryPath);
return (dire.exists() && dire.isDirectory());
* delete file or directory
* &li&if path is null or empty, return true&/li&
* &li&if path not exist, return true&/li&
* &li&if path exist, delete recursion. return true&/li&
* @param path
public static boolean deleteFile(String path) {
if (StringUtils.isBlank(path)) {
File file = new File(path);
if (!file.exists()) {
if (file.isFile()) {
return file.delete();
if (!file.isDirectory()) {
for (File f : file.listFiles()) {
if (f.isFile()) {
f.delete();
} else if (f.isDirectory()) {
deleteFile(f.getAbsolutePath());
return file.delete();
* get file size
* &li&if path is null or empty, return -1&/li&
* &li&if path exist and it is a file, return file size, else return -1&/li&
* @param path
* @return returns the length of this file in bytes. returns -1 if the file does not exist.
public static long getFileSize(String path) {
if (StringUtils.isBlank(path)) {
return -1;
File file = new File(path);
return (file.exists() && file.isFile() ? file.length() : -1);
StringUtils文件
package com.zqsy.order.
import java.io.UnsupportedEncodingE
import java.net.URLE
import java.util.regex.M
import java.util.regex.P
* String Utils
* @author &a href=&& target=&_blank&&Trinea&/a&
public class StringUtils {
private StringUtils() {
throw new AssertionError();
* is null or its length is 0 or it is made by space
* isBlank(null) =
* isBlank(&&) =
* isBlank(&
* isBlank(&a&) =
* isBlank(&a &) =
* isBlank(& a&) =
* isBlank(&a b&) =
* @param str
* @return if string is null or its size is 0 or it is made by space, return true, else return false.
public static boolean isBlank(String str) {
return (str == null || str.trim().length() == 0);
* is null or its length is 0
* isEmpty(null) =
* isEmpty(&&) =
* isEmpty(&
* @param str
* @return if string is null or its size is 0, return true, else return false.
public static boolean isEmpty(CharSequence str) {
return (str == null || str.length() == 0);
* compare two string
* @param actual
* @param expected
* @see ObjectUtils#isEquals(Object, Object)
public static boolean isEquals(String actual, String expected) {
return actual == expected || (actual == null ? expected == null : actual.equals(expected));
* get length of CharSequence
* length(null) = 0;
* length(\&\&) = 0;
* length(\&abc\&) = 3;
* @param str
* @return if str is null or empty, return 0, else return {@link CharSequence#length()}.
public static int length(CharSequence str) {
return str == null ? 0 : str.length();
* null Object to empty string
* nullStrToEmpty(null) = &&;
* nullStrToEmpty(&&) = &&;
* nullStrToEmpty(&aa&) = &aa&;
* @param str
public static String nullStrToEmpty(Object str) {
return (str == null ? && : (str instanceof String ? (String)str : str.toString()));
* capitalize first letter
* capitalizeFirstLetter(null)
* capitalizeFirstLetter(&&)
* capitalizeFirstLetter(&2ab&)
* capitalizeFirstLetter(&a&)
* capitalizeFirstLetter(&ab&)
* capitalizeFirstLetter(&Abc&)
* @param str
public static String capitalizeFirstLetter(String str) {
if (isEmpty(str)) {
char c = str.charAt(0);
return (!Character.isLetter(c) || Character.isUpperCase(c)) ? str : new StringBuilder(str.length())
.append(Character.toUpperCase(c)).append(str.substring(1)).toString();
* encoded in utf-8
* utf8Encode(null)
* utf8Encode(&&)
* utf8Encode(&aa&)
* utf8Encode(&啊啊啊啊&)
= &%E5%95%8A%E5%95%8A%E5%95%8A%E5%95%8A&;
* @param str
* @throws UnsupportedEncodingException if an error occurs
public static String utf8Encode(String str) {
if (!isEmpty(str) && str.getBytes().length != str.length()) {
return URLEncoder.encode(str, &UTF-8&);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(&UnsupportedEncodingException occurred. &, e);
* encoded in utf-8, if exception, return defultReturn
* @param str
* @param defultReturn
public static String utf8Encode(String str, String defultReturn) {
if (!isEmpty(str) && str.getBytes().length != str.length()) {
return URLEncoder.encode(str, &UTF-8&);
} catch (UnsupportedEncodingException e) {
return defultR
* get innerHtml from href
* getHrefInnerHtml(null)
* getHrefInnerHtml(&&)
* getHrefInnerHtml(&mp3&)
* getHrefInnerHtml(&&a innerHtml&/a&&)
= &&a innerHtml&/a&&;
* getHrefInnerHtml(&&a&innerHtml&/a&&)
= &innerHtml&;
* getHrefInnerHtml(&&a&a&innerHtml&/a&&)
= &innerHtml&;
* getHrefInnerHtml(&&a href=&&&innerHtml&/a&&)
= &innerHtml&;
* getHrefInnerHtml(&&a href=&& title=&baidu&&innerHtml&/a&&) = &innerHtml&;
* getHrefInnerHtml(&
&a&innerHtml&/a&
= &innerHtml&;
* getHrefInnerHtml(&&a&innerHtml&/a&&/a&&)
= &innerHtml&;
* getHrefInnerHtml(&jack&a&innerHtml&/a&&/a&&)
= &innerHtml&;
* getHrefInnerHtml(&&a&innerHtml1&/a&&a&innerHtml2&/a&&)
= &innerHtml2&;
* @param href
* @return &ul&
&li&if href is null, return &&&/li&
&li&if not match regx, return source&/li&
&li&return the last string that match regx&/li&
public static String getHrefInnerHtml(String href) {
if (isEmpty(href)) {
return &&;
String hrefReg = &.*&[\\s]*a[\\s]*.*&(.+?)&[\\s]*/a[\\s]*&.*&;
Pattern hrefPattern = pile(hrefReg, Pattern.CASE_INSENSITIVE);
Matcher hrefMatcher = hrefPattern.matcher(href);
if (hrefMatcher.matches()) {
return hrefMatcher.group(1);
* process special char in html
* htmlEscapeCharsToString(null) =
* htmlEscapeCharsToString(&&) = &&;
* htmlEscapeCharsToString(&mp3&) = &mp3&;
* htmlEscapeCharsToString(&mp3&&) = &mp3&&;
* htmlEscapeCharsToString(&mp3&&) = &mp3\&&;
* htmlEscapeCharsToString(&mp3&mp4&) = &mp3&mp4&;
* htmlEscapeCharsToString(&mp3&mp4&) = &mp3\&mp4&;
* htmlEscapeCharsToString(&mp3&&&&mp4&) = &mp3\&\&&\&mp4&;
* @param source
public static String htmlEscapeCharsToString(String source) {
return StringUtils.isEmpty(source) ? source : source.replaceAll(&&&, &&&).replaceAll(&&&, &&&)
.replaceAll(&&&, &&&).replaceAll(&&&, &\&&);
* transform half width char to full width char
* fullWidthToHalfWidth(null) =
* fullWidthToHalfWidth(&&) = &&;
* fullWidthToHalfWidth(new String(new char[] {12288})) = & &;
* fullWidthToHalfWidth(&!"#$%&) = &!\&#$%&&;
* @param s
public static String fullWidthToHalfWidth(String s) {
if (isEmpty(s)) {
char[] source = s.toCharArray();
for (int i = 0; i & source. i++) {
if (source[i] == 12288) {
source[i] = ' ';
// } else if (source[i] == 12290) {
// source[i] = '.';
} else if (source[i] &= 65281 && source[i] &= 65374) {
source[i] = (char)(source[i] - 65248);
source[i] = source[i];
return new String(source);
* transform full width char to half width char
* halfWidthToFullWidth(null) =
* halfWidthToFullWidth(&&) = &&;
* halfWidthToFullWidth(& &) = new String(new char[] {12288});
* halfWidthToFullWidth(&!\&#$%&) = &!"#$%&&;
* @param s
public static String halfWidthToFullWidth(String s) {
if (isEmpty(s)) {
char[] source = s.toCharArray();
for (int i = 0; i & source. i++) {
if (source[i] == ' ') {
source[i] = (char)12288;
// } else if (source[i] == '.') {
// source[i] = (char)12290;
} else if (source[i] &= 33 && source[i] &= 126) {
source[i] = (char)(source[i] + 65248);
source[i] = source[i];
return new String(source);
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:32282次
排名:千里之外
原创:64篇
转载:47篇
(6)(12)(5)(21)(12)(20)(25)(10)

我要回帖

更多关于 recovery找不到内存卡 的文章

 

随机推荐