Although I have been unable to write my blog for the last month, I have been answering your questions carefully. I have a sense of accomplishment after receiving so many replies, attention, and thanks. This makes me feel more and more meaningful and makes me more determined to continue writing. After explaining the previous six articles, I believe you are reading the article.
This article describes the benefits of using line breaks in text messages and how to use line breaks.
Although I have been unable to write my blog for the last month, I have been answering your questions carefully. I have a sense of accomplishment after receiving so many replies, attention, and thanks. This makes me feel more and more meaningful and makes me more determined to continue writing. After explaining the previous six articles, I believe that you have mastered the basic development knowledge (based on Java) of the public account ), such as framework construction, API encapsulation, message receiving and reply; the next series of articles will focus on the development of skills and practical functions in public account development (such as weather query, nearby search, man-machine conversation, etc ).
Benefits and examples of using line breaks
The advantage of using line breaks is to make the information appear more neat, beautiful, and intuitive. using line breaks in text messages will make people feel comfortable, clear, and clear. Below is a public accountXiaoqrobotThe main menu example is to use a line break reasonably. does it look intuitive and refreshing? (What? I think it's ugly? Well, that would be my narcissism ...)
You can imagine what it will look like if this text menu does not use a line break?
How do I use line breaks in text messages?
In text messages of public accounts, the linefeed is still "\ n". the following code is used to explainXiaoqrobotHow is text menu implemented?
[Java]View plaincopyprint?
- /**
- * Main menu of xiaoqrobot
- *
- * @ Return
- */
- Public static String getMainMenu (){
- StringBuffer buffer = new StringBuffer ();
- Buffer. append ("Hello, I am a small Q. please reply to the number selection service:"). append ("\ n ");
- Buffer. append ("1 weather forecast"). append ("\ n ");
- Buffer. append ("2 bus query"). append ("\ n ");
- Buffer. append ("3 search"). append ("\ n ");
- Buffer. append ("4 songs on demand"). append ("\ n ");
- Buffer. append ("5 Classic Games"). append ("\ n ");
- Buffer. append ("6 "). append ("\ n ");
- Buffer. append ("7 face recognition"). append ("\ n ");
- Buffer. append ("8 chat "). append ("\ n ");
- Buffer. append ("reply"?" Show this help menu ");
- Return buffer. toString ();
- }
/*** Main menu of xiaoqrobot ** @ return */public static String getMainMenu () {StringBuffer buffer = new StringBuffer (); buffer. append ("Hello, I am Xiao Q. please reply to the number selection service :"). append ("\ n"); buffer. append ("1 weather forecast "). append ("\ n"); buffer. append ("2 bus query "). append ("\ n"); buffer. append ("3 search "). append ("\ n"); buffer. append ("4 songs on demand "). append ("\ n"); buffer. append ("5 Classic Games "). append ("\ n"); buffer. append ("6 "). append ("\ n"); buffer. append ("7 Face recognition "). append ("\ n"); buffer. append ("8 chat "). append ("\ n"); buffer. append ("reply"?" Show this help menu "); return buffer. toString ();}
How about it?
1) Lines 9-16 are menu items, which are separated by a line break;
2) There are two line breaks at the end of line 8th and line 16th, which can separate the menu items from other contents. This gives you a sense of comfort and looks more comfortable and intuitive.
A careful friend may have discovered that there is a "gift" behind "nearby search" and "beauty station", which is not seen in the code, this is what I specifically removed, because I plan to use an article later to clearly describe the sending, processing, and receipt of QQ expressions.
Details determine success or failure!