public class java3_5 {
public static void main(String[] args) {
StringBuffer str=new StringBuffer("i can not forget you!please give me a chance!");
int i,k=0;
for(i=0;i<str.length();i++)
{
if(str.charAt(i)=='p')
{
k++;
str.setCharAt(i,'P');
}
else continue;
}
System.out.print(str);
}
}
字符串中字符的修改技巧
最新推荐文章于 2023-01-17 11:21:14 发布