Text display method, device, apparatus and storage medium
AssigneeBeijing Zitiao Network Technology Co., Ltd.
InventorsHongwei Tang, Wei Feng, Jun Wen
Life of this patent
Estimating the term…
Abstract
The present disclosure relates to a text display method, device, apparatus, and storage medium, and the method comprises: determining a length of entered text within a first container and a current width of the first container, if it is determined that the current width of the first container is less than the length of the entered text, determining a target truncated character from the entered text; then deleting characters behind the target truncated character in the entered text, and adding a preset symbol at a next position adjacent to the target truncated character to obtain a truncated text corresponding to the entered text; and displaying the truncated text in the first container.
Claims18
A text display method, the method comprising:
- determining a length of entered text within a first container and a current width of the first container;
- the first container is used for bearing texts displayed on a target control;
- if it is determined that the current width of the first container is less than the length of the entered text, determining a target truncated character from the entered text;
- wherein the entered text comprises a plurality of characters;
- deleting characters behind the target truncated character in the entered text, and adding a preset symbol at a next position adjacent to the target truncated character to obtain a truncated text corresponding to the entered text;
- and
- displaying the truncated text in the first container.
A non-transitory computer-readable storage medium having stored therein instructions that, when executed on a terminal device, cause the terminal device to:
- determine a length of entered text within a first container and a current width of the first container;
- the first container is used for bearing texts displayed on a target control;
- if it is determined that the current width of the first container is less than the length of the entered text, determine a target truncated character from the entered text;
- wherein the entered text comprises a plurality of characters;
- delete characters behind the target truncated character in the entered text, and add a preset symbol at a next position adjacent to the target truncated character to obtain a truncated text corresponding to the entered text;
- and
- display the truncated text in the first container.
An apparatus comprising:
- a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor, when executing the computer program, is configured to:
- determine a length of entered text within a first container and a current width of the first container;
- the first container is used for bearing texts displayed on a target control;
- if it is determined that the current width of the first container is less than the length of the entered text, determine a target truncated character from the entered text;
- wherein the entered text comprises a plurality of characters;
- delete characters behind the target truncated character in the entered text, and add a preset symbol at a next position adjacent to the target truncated character to obtain a truncated text corresponding to the entered text;
- and
- display the truncated text in the first container.
Dependencies are inferred from the claim text.