安卓系统:在java中完全停止后,在字符串中开始一个新行



我使用以下代码尝试在句子结束后开始一行,例如"2.把火鸡";将启动一条新线路。但这并没有发生。我做错了什么?

"1.制作墨西哥调味料时,将原料放在碗中混合。2.将火鸡肉糜和墨西哥调味料放入一个大碗中,用手搅拌均匀。3.在煎锅中用大火加热一半的橄榄油,将洋葱、大葱和辣椒煮3分钟。加一小撮盐和胡椒粉。将蔬菜从锅中取出,放在一边。

method.replaceAll("\.\s?", "\.n");
methodText = findViewById(R.id.methodText);
methodText.setText(method);

试试这个。。。。

String method="1.To make the Mexican seasoning, mix the ingredients together in a bowl. 2.Put the turkey mince and Mexican seasoning into a large bowl and mix well with your hands. 3.Heat half the olive oil in a frying pan over a high heat and cook the onions, spring onions and peppers for 3 minutes. Add a pinch of salt and pepper. Remove the vegetables from the pan and set aside.";
String m=method.replaceAll("\. ", ".n");

相关内容

最新更新