CN117113935A - Text editing method and device, electronic equipment and readable storage medium - Google Patents
Text editing method and device, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN117113935A CN117113935A CN202210530924.7A CN202210530924A CN117113935A CN 117113935 A CN117113935 A CN 117113935A CN 202210530924 A CN202210530924 A CN 202210530924A CN 117113935 A CN117113935 A CN 117113935A
- Authority
- CN
- China
- Prior art keywords
- characters
- cursor position
- character
- segment
- text
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000004590 computer program Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 abstract description 15
- 238000010586 diagram Methods 0.000 description 9
- 230000009471 action Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses a text editing method, a device, electronic equipment and a readable storage medium, which are used for identifying whether a selected text segment exists in a current text editing box or not, wherein the selected text segment is at least one segment; acquiring a starting cursor position and an ending cursor position of a selected text segment under the condition that the current text editing box contains the selected text segment; reading and displaying a first character number of the initial cursor position and a second character number of the end cursor position, wherein the first character number is the total number of characters from the initial cursor position to the first character in the current text editing frame, and the second character number is the total number of characters of the selected text segment; the characters in the current text editing box are edited based on the first number of characters and the second number of characters. The process can display the position of the cursor and the corresponding character number, edit the characters in the currently input text box based on the corresponding character number, avoid the condition that the characters need to be repeatedly determined and manually deleted for editing for many times in the prior art, and reduce the operation steps and time.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a text editing method, a text editing device, an electronic device, and a readable storage medium.
Background
Text messages can provide clear information in private network communications, and have the characteristic of easy acquisition. Are widely used in a variety of application scenarios: first, in the case of exchanging sensitive information; second, for use in situations where the environment is noisy and sound cannot be heard; thirdly, the transmission content is slightly longer, and compared with voice communication, the text information reduces the occupation of channel resources; fourth, in some complex instruction cases, text information facilitates recording and subsequent searching.
However, the dedicated network has limited channel resources, and each text message has a limited length, and cannot be transmitted beyond the maximum length. When the text message is longer, the text message can be sent out only by repeated confirmation and repeated manual deletion of the user, and the steps and time of the user operation are increased.
Disclosure of Invention
In view of this, the present application provides a text editing method, apparatus, electronic device and readable storage medium, which are used for solving the problems that in the prior art, when text message is long and text cannot be sent, a user repeatedly confirms and manually deletes characters for many times, and the steps and time of user operation are increased, and the specific scheme is as follows:
a text editing method, comprising:
identifying whether a selected text segment exists in a current text editing box, wherein the selected text segment is at least one segment;
acquiring a starting cursor position and an ending cursor position of the selected text segment under the condition that the current text editing box contains the selected text segment;
reading and displaying a first character number of the initial cursor position and a second character number of the end cursor position, wherein the first character number is the total number of characters from the initial cursor position to a first character in the current text editing box, and the second character number is the total number of characters of the selected text segment;
editing the characters in the current text editing box based on the first character number and the second character number.
In the above method, optionally, when the selected text segment is one segment, reading the first number of characters at the start cursor position and the second number of characters at the end cursor position includes:
identifying a first input character in the current text editing box, and counting a first character number of all characters before the first input character reaches the initial cursor position;
and counting a second character number between the starting cursor position and the ending cursor position.
In the above method, optionally, when the selected text segment is greater than one segment, reading the first number of characters at the start cursor position and the second number of characters at the end cursor position includes:
identifying a first input character in the current text editing box, and counting a first character number from the first input character to the initial cursor position of each text segment according to the initial cursor position of each text segment;
and counting the second character numbers of all the selected text segments before the ending cursor position of each text segment aiming at the ending cursor position of each text segment.
The method, optionally, edits characters in the current text edit box based on the first character number and the second character number, including:
acquiring the number of allowed characters and the number of inputted characters in the current text editing box;
and editing the characters in the current text editing box based on the first character number and the second character number, and determining the characters to be sent in the current text editing box.
The method, optionally, further comprises:
and if clicking any position of the current text editing box is detected under the condition that the current text editing box does not contain the selected text segment, creating a cursor at the any position, and reading and displaying a third character number from the cursor to the first character of the current text editing box.
A text editing apparatus comprising:
the identification module is used for identifying whether a selected text segment exists in the current text editing box, wherein the selected text segment is at least one segment;
the acquisition module is used for acquiring a starting cursor position and an ending cursor position of the selected text segment under the condition that the current text editing box contains the selected text segment;
the reading module is used for reading and displaying a first character number of the initial cursor position and a second character number of the end cursor position, wherein the first character number is the total number of characters from the initial cursor position to the first character in the current text editing frame, and the second character number is the total number of characters of the selected text segment;
and the editing module is used for editing the characters in the current text editing box based on the first character number and the second character number.
In the foregoing apparatus, optionally, in a case where the selected text segment is a segment, the reading module includes:
the identification unit is used for identifying a first input character in the current text editing box and counting the first character number of all characters before the first input character reaches the initial cursor position;
and the first statistics unit is used for counting the second character number between the starting cursor position and the ending cursor position.
In the above apparatus, optionally, in a case where the selected text segment is greater than one segment, the reading module includes:
the identification and statistics unit is used for identifying a first input character in the current text editing box, and counting the first character number from the first input character to the initial cursor position of each text segment according to the initial cursor position of each text segment;
and the second statistics unit is used for counting second character numbers of all selected text segments before the ending cursor position of each text segment aiming at the ending cursor position of each text segment.
An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
the processor invokes the program and is configured to perform the text editing method described above.
A readable storage medium having stored thereon a computer program which, when executed by a processor, implements the text editing method described above.
Compared with the prior art, the application has the following advantages:
the application discloses a text editing method, a text editing device, electronic equipment and a readable storage medium, comprising the following steps: identifying whether a selected text segment exists in the current text editing box, wherein the selected text segment is at least one segment; acquiring a starting cursor position and an ending cursor position of a selected text segment under the condition that the current text editing box contains the selected text segment; reading and displaying a first character number of a starting cursor position and a second character number of an ending cursor position, wherein the first character number is the total number of characters from the starting cursor position to the first character in the current text editing frame, and the second character number is the total number of characters of the selected text segment; the characters in the current text editing box are edited based on the first number of characters and the second number of characters. In the process, the position of the cursor and the corresponding character number can be displayed, the characters in the text box which is input currently are edited based on the corresponding character number, the condition that the characters are required to be repeatedly determined and manually deleted for editing for many times in the prior art is avoided, and the operation steps and time are reduced.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a text edit box character display in the prior art;
FIG. 2 is a schematic diagram of a graphical indication of the amount of data that can be entered in a text edit box according to the prior art;
FIG. 3 is a flowchart of a text editing method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a single cursor text edit box character display mode according to an embodiment of the present application;
FIG. 5 is a schematic diagram showing a character display of a selected text segment in a text editing box according to an embodiment of the present application;
FIG. 6 is a schematic diagram showing the display of characters in a text editing box for two selected text segments according to an embodiment of the present application;
fig. 7 is a block diagram of a text editing apparatus according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The application discloses a text editing method and a text editing device, which are used in the text editing process of characters in a text editing box in a narrow-band private network terminal or a wide-narrow-band fusion terminal of a touch screen. By way of example with a 16bit Unicode encoding format, each text message is limited in length as follows:
simulation clusters: up to 40 characters are supported;
normal mode: up to 256 characters are supported;
digital cluster: the short message supports 23 characters at most and the long short message supports 500 characters at most;
in the prior art, the text editing box displays the number of the remaining characters which can be input, a plurality of long texts are often input by copy and paste, and when the pasted texts are longer than the limiting length, the editing interface only prompts that the word number reaches the upper limit and the number of the exceeding characters, and the input can still be continued.
As shown in fig. 1, the text edit box inputs 98 characters with a super length, at least 98 characters need to be deleted to successfully send the text, if the characters in the text edit box exceed the limit length, the text edit box cannot be sent, and the user needs to manually delete redundant characters to reserve the text content wanted by the user. Exceeding the limit length overlength, more needs the user to repeatedly reciprocate many times, looks over text content, through many times selection and deletion, can let text length satisfy the restriction requirement, and operation mode is loaded down with trivial details, can cause the poor problem of user experience. Further, excessive text contents can be completely edited by sliding up and down for many times, so that the difficulty of selecting and confirming by a client is increased, and once the text is deleted, the text cannot be recovered, so that the text editing is time-consuming and the friendliness is insufficient.
In the text editing process, as shown in fig. 2, the data amount which can be input in the editing field is indicated graphically, the indication is too fuzzy, only approximate estimation is possible, exact quantization is impossible, and the problem of too many copy and paste characters cannot be well solved.
Based on the above-mentioned problems, the present application provides a text editing method, the execution flow of which is shown in fig. 3, comprising the steps of:
s101, identifying whether a selected text segment exists in a current text editing box, wherein the selected text segment is at least one segment;
in the embodiment of the application, aiming at the current text editing box, the number of cursors in the current text editing box is identified, and whether a selected text segment exists in the current text editing box is determined based on the number of cursors, wherein the specific determination process is as follows: and if the number of the cursors is greater than 1, judging that the selected text segment exists in the current text editing box, wherein the selected text segment is at least one segment, and if the number of the cursors is equal to 1, judging that the selected text segment does not exist in the current text editing box.
Further, if it is detected that clicking an arbitrary position of the current text editing box is performed when the current text editing box does not include the selected text segment, a cursor is created at the arbitrary position, and a third number of characters between the cursor and a first character of the current text editing box is displayed, as shown in fig. 4, and specific schematic diagrams are shown, in the current text editing box, input: patent patent ", the upper limit of the text content is 256 characters, the number of the allowed input characters is 240 currently, in the case of a single cursor, the third number of characters between the cursor displayed under the cursor to the first character in the current text editing box is 3.
In the embodiment of the application, the current text editing box supports a touch screen terminal, and the terminal comprises but is not limited to an android system, an ios system and other systems (different terminals may have different graphic user systems), and as long as an input method is supported, the control can support to acquire the cursor position, and the number of characters in front of the cursor can be acquired. Taking the android system as an example, the function interface for acquiring the cursor position is a getSelectionStart () interface in textview.
S102, acquiring a starting cursor position and an ending cursor position of the selected text segment under the condition that the current text editing box contains the selected text segment;
in the embodiment of the present application, when the current text editing box includes the selected text segment, the number of texts in the current text editing box is determined, for example, when the current text editing box includes two cursors, the selected text segment in the current text editing box is one segment, and the two cursors are a start cursor position and an end cursor position, respectively, where the start cursor position displays a total number of characters from a first character in the current text editing box to a first character before the start cursor position, and the end cursor position represents a total number of characters from the start cursor position to the end cursor position, that is, a second number of characters. For the calculation of the total number of characters, taking a terminal developed by an android system as an example, the getSelectionStart () in the initial cursor position textview, the ending cursor position getSelectionEnd (), and the total number of characters is the ending cursor position minus the initial cursor position. As shown in fig. 5, the total number of characters from the start cursor position to the first character in the current text editing box is 208, the total number of characters from the end cursor position to the selected text segment is 28, the current text editing box exceeds 98 characters with a limiting length, preferably, the first number of characters is displayed below the start cursor position, and the second number of characters is displayed below the end cursor position.
Further, under the condition that the selected text segment is larger than one segment, identifying a first input character in the current text editing box, and counting the first character number from the first input character to each initial cursor position according to each initial cursor position; for each end cursor position, counting the second character number of all the selected text segments before each end cursor position, wherein the specific counting process is the same as the counting process of a single selected text segment, and the details are not repeated here. Taking two selected text segments as an example for illustration, a specific schematic diagram is shown in fig. 6, for a first selected text segment, the total number of characters from the start cursor position to the first character in the current text editing box, that is, the first number of characters is 186, the total number of characters from the selected text segment before the end cursor position, that is, the second number of characters is 7, the current text editing box exceeds 98 characters with a limit length, preferably, the first number of characters is displayed below the start cursor position, the second number of characters is displayed below the end cursor position, a specific processing procedure is the same as that of a single selected text segment, for a second selected text segment, the total number of characters from the start cursor position to the first character in the current text editing box, that is, the first number of characters is 208, the total number of characters from the selected text segment before the end cursor position, that is 35 (the first number of characters (first segment of selected text) +the second selected text (28 characters)), preferably, the first number of characters is displayed below the start cursor position, and the second number of characters is displayed below the start cursor position.
S103, reading and displaying a first character number of the initial cursor position and a second character number of the end cursor position, wherein the first character number is the total number of characters from the initial cursor position to the first character in the current text editing frame, and the second character number is the total number of characters of the selected text segment;
in the embodiment of the application, the first character number is read and displayed at the initial cursor position, the second character number is read and displayed at the end cursor position, and the initial cursor position and the end cursor position are in pairs when at least one selected text segment exists in the current text editing frame, wherein the number of the first character number and the second character number is related to the number of the selected text segment, the first character number is the total number of characters from the initial cursor position to the first character in the current text editing frame, and the second character number is the total number of characters of the selected text segment.
S104, editing the characters in the current text editing box based on the first character number and the second character number.
In the embodiment of the present application, the number of allowed characters to be input and the number of inputted characters in the current text editing box are obtained, and the characters in the current text editing box are edited according to the first number of characters and the second number of characters, wherein the editing process may include operations such as cutting, deleting, copying, and not processing, for example, deleting part of the characters when the number of inputted characters is greater than the number of allowed characters, copying part of the characters when the number of inputted characters is less than the number of allowed characters, and finally determining the characters to be sent in the current text editing box.
The application discloses a text editing method and a text editing device, comprising the following steps: identifying whether a selected text segment exists in the current text editing box, wherein the selected text segment is at least one segment; acquiring a starting cursor position and an ending cursor position of a selected text segment under the condition that the current text editing box contains the selected text segment; reading and displaying a first character number of a starting cursor position and a second character number of an ending cursor position, wherein the first character number is the total number of characters from the starting cursor position to the first character in the current text editing frame, and the second character number is the total number of characters of the selected text segment; the characters in the current text editing box are edited based on the first number of characters and the second number of characters. In the process, the position of the cursor and the corresponding character number can be displayed, the characters in the text box which is input currently are edited based on the corresponding character number, the condition that the characters are required to be repeatedly determined and manually deleted for editing for many times in the prior art is avoided, and the operation steps and time are reduced.
In the embodiment of the application, aiming at the text editing method, when the text message exceeds the limit length and can not be sent, the current position of the cursor and the length of the selected text segment are clearly indicated, so that a user can edit and select quickly, and then the text message is successfully sent; support to select multiple text segments simultaneously and indicate the total number of characters for all selected text segments. Firstly, under the condition of limited length of characters, a user can quickly select the text content wanted to be successfully transmitted, the user can conveniently and quickly delete redundant useless characters, and meanwhile, a receiver can quickly identify important information, so that the requirement that the user can transmit key information by one piece of information is met; aiming at text editing, an implementation mode meeting the editing requirements of users is established, and user experience is greatly improved.
Based on the above-mentioned text editing method, the embodiment of the present application further provides a text editing apparatus, where a structural block diagram of the apparatus is shown in fig. 7, and the apparatus includes:
an identification module 201, an acquisition module 202, a reading module 203 and an editing module 204.
Wherein,
the identifying module 201 is configured to identify whether a selected text segment exists in the current text editing box, where the selected text segment is at least one segment;
the obtaining module 202 is configured to obtain a start cursor position and an end cursor position of the selected text segment if the current text editing box includes the selected text segment;
the reading module 203 is configured to read and display a first number of characters at the start cursor position and a second number of characters at the end cursor position, where the first number of characters is a total number of characters from the start cursor position to a first character in the current text editing box, and the second number of characters is a total number of characters in the selected text segment;
the editing module 204 is configured to edit a character in the current text editing box based on the first number of characters and the second number of characters.
The application discloses a text editing device, comprising: identifying whether a selected text segment exists in the current text editing box, wherein the selected text segment is at least one segment; acquiring a starting cursor position and an ending cursor position of a selected text segment under the condition that the current text editing box contains the selected text segment; reading and displaying a first character number of a starting cursor position and a second character number of an ending cursor position, wherein the first character number is the total number of characters from the starting cursor position to the first character in the current text editing frame, and the second character number is the total number of characters of the selected text segment; the characters in the current text editing box are edited based on the first number of characters and the second number of characters. In the process, the position of the cursor and the corresponding character number can be displayed, the characters in the text box which is input currently are edited based on the corresponding character number, the condition that the characters are required to be repeatedly determined and manually deleted for editing for many times in the prior art is avoided, and the operation steps and time are reduced.
In the embodiment of the present application, in the case where the selected text segment is one segment, the obtaining module 202 includes:
an identification unit 205 and a first statistics unit 206.
Wherein,
the identifying unit 205 is configured to identify a first input character in the current text editing box, and count a first number of characters of all characters before the first input character reaches the start cursor position;
the first statistics unit 206 is configured to count a second number of characters between the start cursor position and the end cursor position.
In the embodiment of the present application, in the case that the selected text segment is greater than one segment, the reading module 202 includes:
an identification and statistics unit 207 and a second statistics unit 208.
Wherein,
the identifying and counting unit 207 is configured to identify a first input character in the current text editing box, and count, for each text segment, a first number of characters from the first input character to the start cursor position of each text segment;
the second statistics unit 208 is configured to, for each text segment, count, for each text segment, second character numbers of all selected text segments before the end cursor position of the text segment.
In an embodiment of the present application, the editing module 204 includes:
an acquisition unit 209, and an editing unit 210.
Wherein,
the obtaining unit 209 is configured to obtain the number of characters allowed to be input and the number of characters already input in the current text editing box;
the editing unit 210 is configured to edit the characters in the current text editing box based on the first number of characters and the second number of characters, and determine the characters to be sent in the current text editing box.
In an embodiment of the present application, the apparatus further includes: the module 211 is created and presented.
Wherein,
the creating and displaying module 211 is configured to, if the current text editing box does not include the selected text segment, create a cursor at an arbitrary position of the current text editing box if clicking the arbitrary position is detected, and display a third number of characters from the cursor to a first character of the current text editing box.
It should be noted that, for the specific implementation process of each module in this embodiment, please refer to the corresponding description in the above embodiment, and no further description is given here.
Optionally, on the basis of the embodiments of the text editing method and apparatus, another embodiment of the present application provides an electronic device, including: a memory and a processor;
wherein the memory is used for storing programs;
the processor invokes the program and is configured to perform the text editing method described above.
Alternatively, on the basis of the embodiments of the above text editing method, apparatus and electronic device, another embodiment of the present application provides a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above text editing method.
In the embodiment of the application, whether a selected text segment exists in a current text editing box is identified, wherein the selected text segment is at least one segment; acquiring a starting cursor position and an ending cursor position of a selected text segment under the condition that the current text editing box contains the selected text segment; reading and displaying a first character number of a starting cursor position and a second character number of an ending cursor position, wherein the first character number is the total number of characters from the starting cursor position to the first character in the current text editing frame, and the second character number is the total number of characters of the selected text segment; the characters in the current text editing box are edited based on the first number of characters and the second number of characters. In the process, the position of the cursor and the corresponding character number can be displayed, the characters in the text box which is input currently are edited based on the corresponding character number, the condition that the characters are required to be repeatedly determined and manually deleted for editing for many times in the prior art is avoided, and the operation steps and time are reduced. It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other. For the apparatus class embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference is made to the description of the method embodiments for relevant points.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in the same piece or pieces of software and/or hardware when implementing the present application.
From the above description of embodiments, it will be apparent to those skilled in the art that the present application may be implemented in software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present application.
The text editing method, device, electronic equipment and readable storage medium provided by the application are described in detail, and specific examples are applied to illustrate the principle and implementation of the application, and the description of the above examples is only used for helping to understand the method and core ideas of the application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
Claims (10)
1. A text editing method, comprising:
identifying whether a selected text segment exists in a current text editing box, wherein the selected text segment is at least one segment;
acquiring a starting cursor position and an ending cursor position of the selected text segment under the condition that the current text editing box contains the selected text segment;
reading and displaying a first character number of the initial cursor position and a second character number of the end cursor position, wherein the first character number is the total number of characters from the initial cursor position to a first character in the current text editing box, and the second character number is the total number of characters of the selected text segment;
editing the characters in the current text editing box based on the first character number and the second character number.
2. The method of claim 1, wherein, in the case where the selected text segment is one segment, reading the first number of characters of the start cursor position and the second number of characters of the end cursor position comprises:
identifying a first input character in the current text editing box, and counting a first character number of all characters before the first input character reaches the initial cursor position;
and counting a second character number between the starting cursor position and the ending cursor position.
3. The method of claim 1, wherein reading the first number of characters of the start cursor position and the second number of characters of the end cursor position if the selected text segment is greater than one segment comprises:
identifying a first input character in the current text editing box, and counting a first character number from the first input character to the initial cursor position of each text segment according to the initial cursor position of each text segment;
and counting the second character numbers of all the selected text segments before the ending cursor position of each text segment aiming at the ending cursor position of each text segment.
4. The method of claim 1, wherein editing the characters in the current text editing box based on the first number of characters and the second number of characters comprises:
acquiring the number of allowed characters and the number of inputted characters in the current text editing box;
and editing the characters in the current text editing box based on the first character number and the second character number, and determining the characters to be sent in the current text editing box.
5. The method as recited in claim 1, further comprising:
and if clicking any position of the current text editing box is detected under the condition that the current text editing box does not contain the selected text segment, creating a cursor at the any position, and reading and displaying a third character number from the cursor to the first character of the current text editing box.
6. A text editing apparatus, comprising:
the identification module is used for identifying whether a selected text segment exists in the current text editing box, wherein the selected text segment is at least one segment;
the acquisition module is used for acquiring a starting cursor position and an ending cursor position of the selected text segment under the condition that the current text editing box contains the selected text segment;
the reading module is used for reading and displaying a first character number of the initial cursor position and a second character number of the end cursor position, wherein the first character number is the total number of characters from the initial cursor position to the first character in the current text editing frame, and the second character number is the total number of characters of the selected text segment;
and the editing module is used for editing the characters in the current text editing box based on the first character number and the second character number.
7. The apparatus of claim 6, wherein, in the case where the selected text segment is a segment, the reading module comprises:
the identification unit is used for identifying a first input character in the current text editing box and counting the first character number of all characters before the first input character reaches the initial cursor position;
and the first statistics unit is used for counting the second character number between the starting cursor position and the ending cursor position.
8. The apparatus of claim 6, wherein, in the case where the selected text segment is greater than one segment, the reading module comprises:
the identification and statistics unit is used for identifying a first input character in the current text editing box, and counting the first character number from the first input character to the initial cursor position of each text segment according to the initial cursor position of each text segment;
and the second statistics unit is used for counting second character numbers of all selected text segments before the ending cursor position of each text segment aiming at the ending cursor position of each text segment.
9. An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
a processor invokes a program and is adapted to perform the text editing method of any of claims 1-5.
10. A readable storage medium having stored thereon a computer program which, when executed by a processor, implements the text editing method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210530924.7A CN117113935A (en) | 2022-05-16 | 2022-05-16 | Text editing method and device, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210530924.7A CN117113935A (en) | 2022-05-16 | 2022-05-16 | Text editing method and device, electronic equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117113935A true CN117113935A (en) | 2023-11-24 |
Family
ID=88798883
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210530924.7A Pending CN117113935A (en) | 2022-05-16 | 2022-05-16 | Text editing method and device, electronic equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117113935A (en) |
-
2022
- 2022-05-16 CN CN202210530924.7A patent/CN117113935A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI683251B (en) | Interface display method and device | |
CN110505141B (en) | Instant messaging message processing method and device, readable medium and electronic equipment | |
CN106168874B (en) | webpage-based multimedia message editing method and device | |
US10650085B2 (en) | Providing interactive preview of content within communication | |
WO2021036062A1 (en) | Task creation method, apparatus and device, and storage medium | |
CN106844453B (en) | Electronic file format conversion method | |
CN109389365B (en) | Multi-person collaborative document processing method and device and electronic equipment | |
CN115079872B (en) | Document processing method, device, equipment and medium | |
CN105867820A (en) | Text editing method and device for touch screen | |
CN113722124B (en) | Content processing method, device, equipment and storage medium of cloud mobile phone | |
EP3624403A1 (en) | File sending in instant messaging application | |
CN103076955A (en) | Method, device and terminal for adjusting characters of application | |
CN110120908B (en) | Group message processing method and device and server | |
US20190058756A1 (en) | Method, Terminal, and System for Sending Office Document | |
CN113076288A (en) | File processing method and device, electronic equipment and storage medium | |
CN113486635A (en) | Document editing method and device, electronic equipment and computer readable medium | |
US11922002B2 (en) | Notification display in message session | |
CN112486966A (en) | Expired data cleaning method and device and electronic equipment | |
CN117113935A (en) | Text editing method and device, electronic equipment and readable storage medium | |
US9424256B2 (en) | Method and apparatus for performing type-aware change tracking in a document | |
CN115470767A (en) | Document processing method and device, electronic equipment and computer readable medium | |
CN115022266A (en) | Group member adding method, device, equipment and medium | |
CN111158838B (en) | Information processing method and device | |
CN109391541B (en) | Information sending method, device, storage medium and equipment | |
CN112800741A (en) | Task execution method, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |