Android Studio自动清除txt文件中的多余空间 [英] Android Studio Automatically Erases Extra Spaces In txt Files

查看:260
本文介绍了Android Studio自动清除txt文件中的多余空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不是一个编程问题,而是一个专门关于Android Studio的问题.

This isn't exactly a programming question, but it's a question specifically about Android Studio.

我正在开发一个歌词应用程序,我被要求将和弦添加到歌曲中,这就是我正在做的事情.因此,我以以下方式格式化了歌曲;我在第1行有和弦,在下一行有歌词.为了使和弦和歌词正确显示,我需要将和弦线的长度与歌词线的长度完全相同.这通常包括在和弦线的末尾添加一些空格以匹配长度.但是我注意到,Android Studio最后会自动删除所有必要的空格.

I am working on a song lyrics app, and I am I have been asked to add the chords to songs, which is what I am doing. So I have the songs formatted in the following way; I have chords on 1 line, and lyrics on the next. In order to have the chords and lyrics show up properly, I need the chord line to be the exact same length as the lyrics line. This usually includes adding a few spaces at the end of the chord line, to match the length. But I noticed that Android Studio automatically erases all the necessary spaces at the end.

关于我可以做什么的任何建议??

Any suggestions on what I could do??

推荐答案

有一种方法可以在strings.xml文件中用双引号添加spaces.请参阅此 doc

There's a way to add spaces in your strings.xml file with double quotes. Please refer this doc

<string name="my_space_string">"    This will work perfectly   "</string>

或仅使用 UTF代码添加空格.

<string name="my_space_string">\u0020\u0020This will work perfectly.\u0020\u0020</string>

希望对您有帮助.

这篇关于Android Studio自动清除txt文件中的多余空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆