Flex 4 - display of the first n characters in a text block

I have a set of data one of whose fields is a description of the product can be up to 800-900 characters long. I need to display than the first, say 200 characters. Example:

The full field is

(Stimulant free) natural appetite control 90 capsules item catalog number: 00891 a study published in the Journal of the American Medical Association reveals that overweight adults who have completed a program of modest reductions of body fat mass calorie restriction

I want to display

(Stimulant free) natural appetite control 90 capsules item catalog number: 00891 a study published in the Journal of the American Medical Association has found that overweight adults ...

I use a < s:TextArea >.

Any ideas on how to proceed would be greatly appreciated.

Carlos

Hello

The strings have a substring function, it also works with the text property of such components which channels.

var s1:String = "hello world";

var s2:String = s1.substr (0.7);

or with linebreaks
mytextArea1.text mytextArea2.text.substr = (0.100);
David.

Tags: Flex

Similar Questions

  • How to: Extract the first three characters of a text field

    Greetings-

    What is the best method to extract the first three letters of a text field?

    I need to extract the first three letters of a text field (surname in this case),
    so I add other components to create an identification number for
    a person.

    This identification number which must be created consists of the
    date of the person by birth, last 4 digits of social security number and
    the first three letters of the person's first name.

    Example:
    == > Date of birth: 15/11/45
    == > Last 4 SSN: 6654
    == > Name: Smith

    Identification number would be:
    == > 1115456654SMI

    Leonard B


    That should do the trick:

    I put your values in the variable, simply replace the names, according to the needs


    This removes all the string of the / your birthday (if it's a string!) and puts it in the variable id:

    It takes the 4 last letters/digits of your social security number string and adds it to the id:

    It takes the first thre letters/numbers from your last name variable, capitalizes and adds to the identification string

    It will be useful.

  • SQL query to get the first four characters of an address

    Hi gurus,


    Can you please help me with the below quries on how to achieve this. Could be really helpful if you could provide a sample sql on your side.


    Req:

    I have a requriement where I should display the first four characters other than a space to address, for example: becomes R, DISH etc. F. in passing in a ROOM address a DISH 1 FLORIAN AVENUE would therefore "RAF1", while a CORNER, 23 STREET address would be "23CO".


    Words such as c/o, co, rear should be ignored, if any.

    Thanks in advance.


    Kind regards

    Peoples

    Hi John,.

    Here is an implementation of a pl/sql function that suggested a franc. It uses two lists, one with the words which are replaced with the first character and a second with words to ignore.

    create or replace function first_four (p_input in varchar2) return varchar2 is

    type t_words is table of the varchar2 (100);

    p_replace t_words: = t_words ('ROOM', 'FIELD', 'FLAT', 'FLT', 'BLOCK', 'UNIT', 'STUDIOS', 'CARAVAN', 'APARTMENT');

    p_ignore t_words: = t_words ("C/o ', 'CO', 'BACK TO'");

    v_input varchar2 (100);

    Start

    -Put the entry in a local-variable he

    v_input: = upper (p_input);

    -delete the words contained in the ignore list

    because me in 1.p_ignore.count

    loop

    v_input: = replace (v_input, p_ignore (i));

    end loop;

    -Replace the words by first character in the replacement list

    for r in 1.p_replace.count

    loop

    v_input: = replace (v_input, p_replace (r), substr (p_replace (r), 1, 1));

    end loop;

    -remove the spaces and return only the first 4 characters

    Return substr (replace (v_input, ' '), 1, 4);

    end;

    /

    It returns the expected results for the four examples you gave:

    SQL > with t as)

    2 select address 'FLAT 3 a 12 LILLYHAM ROAD' of all the double union

    3 select ' GREE LANE GLOSONTH 45' across Union double

    4 Select "FLAT 3 221 b Baker Street," of all the double union

    5. Select "C/o CARAVAN 32 STREET BLOK 6 RICHMOOND' of the double)

    6. Select ff first_four (address) of t;

    FF

    --------------------------------------------------------------------------------

    F3A1

    45GR

    F322

    C32B

  • If someone checks the mail from yahoo to my computer, their code is displayed if the first letter from my ID is the same with theirs. How can I delete their history on my computer?

    If someone checks the mail from yahoo to my computer, their code is displayed if the first letter from my ID is the same with theirs. How can I delete their history on my computer?

    Hey ioanaatc,

    Go in Tools > Options > Security tab click on passwords saved. This will give you a list of sites that you have saved passwords yahoo just find and delete other connections

    There are a lot of useful information in this article on the Firefox Password Manager. He should answer any other questions you might have.

    It can be saved as Auto form fill data. If this is the case, the article I just linked will show you you how to remove these entries as well.

    Hope this helps!

  • Using ListView with ArrayDataModel displays only the first element in each QVariantMap within the matrix

    I have this QML who have a ListView with datasource to a full ArrayDataModel from the CPP file for creationcompleted, I loop in the table to add the hour together to appear as a label on the page, what works. However, when I want to view these items in the list, it will display only the first element of the QVariantMap within the table, no error on the log of the device. Also, triggered more does not work, but when I click it, it will have a blue border surrounding it, but the onTriggered does not fire.

    Here is an excerpt of the CPP on the table fill

    This-> eventsModel = new ArrayDataModel();

    QVariantMap event;

    event ['EventName'] = "Event1";

    event ["EventHour"] = "00";

    event ["EventMinute"] = "01";

    event ["EventSecond"] = '02 ";

    QML-> setContextProperty ("eventsModel", it-> eventsModel);

    Here's the QML

    {Of container

    ID: eventListContainer

    {To ListView

    ID: eventList

    dataModel: eventsModel

    Use a ListItemComponent to customize the appearance of the list view

    listItemComponents:]

    {ListItemComponent}

    type: 'point '.

    {StandardListItem}

    Title: 'Event' + ListItemData.EventName;

    Description: "time:" + ListItemData.EventHour + ":" + ListItemData.EventMinute + ":" + ListItemData.EventSecond; "»

    }

    }

    ]

    onTriggered: {}

    var selectedEvent = dataModel.data (row);

    var eventDetailPage = eventDetailDefinition.createObject ();

    eventDetailPage.txtEventName.text = selectedEvent ['EventName'];

    eventDetailPage.pickEventTime.value = picker.dateFromTime(selectedEvent["EventHour"]+":"+selectedEvent["EventMinute"]+":"+selectedEvent["EventSecond"]);

    eventDetailPage.open ();

    }

    }

    Any help would be appreciated.

    Thank you.

    ListView determines ItemType of the element by calling the function itemType of the dataModel. By default, an ArrayDataModel returns an empty string for this call (see https://developer.blackberry.com/cascades/reference/bb__cascades__arraydatamodel.html).

    This leaves you with a few options:

    (1) If you have no header and all the elements are the same, you can make

    ListItemComponent {
         type: ""
         ...
    

    (2) If you have headers or different elements, you can extend ArrayDataModel and implement your own function of itemType

    (3) you can define a function of ItemType on your ListView in QML. Documentation:

    ListView called DataModel::itemType() for each item in order to know the type. QML, this can be overridden by declaring the itemType function (data, row) on the ListView element. ListView then call this function instead of the function DataModel.

    Here's how to create a list in QML which creates a header for all items on the high level and aStandardListItem for each item below the top level:

  • How to remove the first few characters of a string of liquid

    I would like to delete the first three characters of a string of liquid. The question is how.

    If I use the markup according to liquid when I know what are the first characters

    {{it. {{["Estate status'] | strip_html | remove_first:"11."}}

    It will remove the 11 characters.

    But if I don't know what are the first characters, this markup can I use to get "RID" of the first three characters?

    I tried 'split' and 'slice', but it must always know what characters to split or slice.

    Thanks for any help.

    Kind regards

    Carla

    Assign a value into slices and you can have table data that you can get out.

  • v$ fixed_view_definition where and ' GV$ SESSION "= only the first 4000 characters

    Hi all

    I need to get the defeintion of the opinion GV$ SESSION.

    I get only the first 4000 characters.

    Select * from v$ fixed_view_definition where view_name = "GV$ SESSION;

    Could you please help me?

    Thank you

    Cherif.

    Cherif bh wrote:

    Hi Martin,

    Thanks for your help. I use 11.2.0.3 and is EXPAND_SQL_TEXT added 12 c.

    I try to get the definition of a problem of performance on gv$ session; I need a list of the tables and columns and add the best predicates and access them using indices

    You should be able to get the same thing on 11.2.0.3 too:

    https://jonathanlewis.WordPress.com/2012/07/10/expanding-SQL/

    The package is called DBMS_SQL2 it.

    Randolf

  • I have a text field. I need to remove the first 8 characters of the field, leaving the remaining characters. Help?

    I have a text field. I need to remove the first 8 characters of the field, leaving the remaining characters. Help?

    Example:

    Text Example.JPG

    I need to remove these numbers PXXXXXX. Leaving the other characters.

    Thank you

    Bob

    A normal 'substring' is what you're looking for.

    For a formula of the column in the response criteria tab:

    SUBSTRING ("YourPresTable". "YourPresColumn" OF 9)

    To make the RPD and the workload of shipping off the coast to the database rather than forcing the work on the server of the OBI or presentation:

    Substring ("01 - Sample App Data (ORCL)" ".." ") "" "BISAMPLE '." " D10 product (dynamic table)". ("' Prod_Dsc ' 9)

  • Delete the first 4 characters in a cell... (IND CS4)

    I need to delete the first 4 characters if the text of the cells begins by "< Cs.


    Is it possible without using "find/replace"?

    My script is something like that... 


    var doc=app.documents[0]; 
    var allTablesArray=doc.stories.everyItem().tables.everyItem().getElements();
    
    
    /************************************************************************/
    var TbCount = allTablesArray.length;
    for(var Tb=0; Tb<TbCount; Tb++) {
      var Tab = allTablesArray[Tb];
      var numRows = Tab.rows.length - 1;
      for(var R=numRows; R>=0; R--) {
      var numCells = Tab.rows[R].cells.length - 1;
      for(var Td=numCells; Td>=0; Td--) {
      var xCell = Tab.rows[R].cells[Td];
      var Content_3 = xCell.contents.slice(0,3);
      if (Content_3 == "<Cs") {
      //Remove the first 4 characters in the cell
      }
      if (Content_3 == "<Rs") {
      //Remove the first 4 characters in the cell
      }
      }
      }
    }
    //*****************
    
    

    Hello

    Try this...

    var doc=app.documents[0];
    var allTablesArray=doc.stories.everyItem().tables.everyItem().getElements();  
    
    /************************************************************************/
    var TbCount = allTablesArray.length;
    for(var Tb=0; Tb=0; R--) {
        var numCells = Tab.rows[R].cells.length - 1;
            for(var Td=numCells; Td>=0; Td--) {
            var xCell = Tab.rows[R].cells[Td];
            var Content_3 = xCell.contents.slice(0,3);
                if (Content_3 == "		   
  • How can I remove the first 3 characters of the files?

    I'm using the bridge for a while and rename the lot

    How can I rename to remove the first 3 characters of the files?

    (these are numbers)

  • GREP string to select the first 2 characters of an e-mail address

    I want o apply the formatting for the first two characters of an e-mail address:

    [email protected]

    the party @domain.com never changes so I can simply place in parentesis.

    So far I managed to isolate the word in front of the e-mail domain:

    \w+([email protected])

    I want to select only the first two characters of the word before the @domain.com

    any ideas?

    Thank you!

    No, sorry. Try this:

    \b[-\w]{2}(?=[-\w]+@domain\.com)

  • Script to remove the first few characters of a PDF file name?

    I know it should be easy, but I'm not a coder and don't have many opportunities to write scripts.  I hope it's like a second request two anyone out there.  All I want to do is point a script in a PDF file that will review the file name, cut the first two characters of the file name and save the original file again.  I need to do this about 400 PDF documents on a recurring basis, hence the need for a script.  Thus, for example, if I have a C:/temp/myFile.pdf file, I would the script to rename the file to just "file.pdf".

    Any help would be greatly appreciated.

    JBF

    Use this code in your action (note that this will not work if your file name)

    contains the comma):

    var filePath = this.path.replace(this.documentFileName,"");

    var NouveauNomFichier = this.documentFileName.substring (2);

    this.saveAs (filePath + newFileName);

  • The first 250 characters of the HTML output

    Is anyone know how the first 250 characters of html output file.
    I use a cfinclude to the output file, but sometimes the HTML is really long and there are other things on the page. I would like to limit the HTML for a number of characters and to give the user an option to read the rest.
    An example but this is not a job would be < cfinclude template = "#left(file.htm, 250) #" >. I know that this does not work, but he would if the information was in a database.

    Any suggestions?
    Thank you




    #left(mytext, 250) #.

    You may also want to strip all html out of var mytext tags in the order
    do not have CF cut in the middle of a tag and make it to the exit:

    #left (trim (rereplace (mytext, "<[^>] * >", "", "all")), 250).

    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com/

  • Only the first 70 characters of an output string

    Hey this is probably an easy question for anyone to answer. I googled and could not find anything. I'm a value in a table, it's more than 70 characters long, but when I use DBMS_OUTPUT. Put_line I want only the first 70 characters of output. How can I do this?

    Thank you!

    SUBSTR

  • How to remove the first 11 characters of a string

    With the help of ' XML Publusher Desktop / generator model for Word / 5.6 Build 45'

    I use XML Publisher. With the help of a RTF model, to generate purchase orders by email of the purchase of the Oracle.

    The fields are drawn from the XML code generated by Oracle.

    One of the fields is the place of delivery Description field.

    Will appear in the report as follows:

    * & lt;? SHIP_TO_LOCATION_NAME? & gt; *

    When I attach a test XML file in Word and view the output, one of my test case returns a description of the site:

    DON'T code USE County Hall of Global location

    What I have to do is to remove the * DO NOT USE * according to the description of the location.

    I could do is a Find / Replace, or a substring to ignore the first 11 characters from the string. But I don't know how to do it.

    Any help would be much appreciated, because it is a production problem that is causing a bit of a small problem for us!

    Thank you very much.

    Hello
    Maybe you know this syntax :)

    Rahul

Maybe you are looking for