23,407
社区成员
发帖
与我相关
我的任务
分享
package com.inspur.date;
import java.util.ArrayList;
import java.util.List;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Administrator
*/
public class T {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String str;
str="d:\\数\\b\\c";
int m=str.length();
int n;
List<String> strF = new ArrayList<String>();
for(int i=0;i<str.length();i++)
{
strF.add(str.substring(i, i+1));
}
for(int k=m-1;k>=0;k--)
{
if(strF.get(k).equalsIgnoreCase("\\"))
{
strF.add(k, "\\");
}
}
for(int i=0;i<strF.size();i++){
System.out.print(strF.get(i));
}
}
}
package com.inspur.date;
import java.util.ArrayList;
import java.util.List;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Administrator
*/
public class T {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String str;
str="d:\\数\\b\\c";
int m=str.length();
int n;
List<String> strF = new ArrayList<String>();
for(int i=0;i<str.length();i++)
{
strF.add(str.substring(i, i+1));
}
for (int i = 0; i < strF.size(); i++) {
System.out.print(strF.get(i));
}
for(int k=m-1;k>=0;k--)
{
if(strF.get(k).equalsIgnoreCase("\\"))
{
strF.add(k, "\\");
}
}
for(int i=0;i<strF.size();i++){
System.out.print(strF.get(i));
}
}
}