Character count function

can anyone help me find how many "|" in the string? does
coldfusion has the function for it?
<cfset variables.teststring =
"343|4w3|||jenny||sfsdfsd">
thank you!

paross1 wrote:
> Ian, you did a slight oops, but otherwise I think that
it is a good
> solution....
>
> <cfset variables.pipes =
len(rereplace(variables.teststring,"^|","","ALL"))>
> should actually be
> <cfset variables.pipes =
len(rereplace(variables.teststring,"[^|]","","ALL"))>
>
> Since ^| only means NOT | if it is enclosed itn [ ]
brackets.
>
> Phil
>
That's what I get for typing my code into an e-mail editor.
The
'debugger' sucks! :-)
Thanks for the correction.

Similar Messages

  • Moto G 4g text character count

    Morning guys, Does anyone know if the Moto G 4g has a text character count function??  I've had a look but can't seem to find it!  Thanks in advance.  Charlie. 

    gindygoo wrote:
    It's just not there though...? Lol it's been on every one of my other Motorola phones too... It's not in tugo either!
    Am I being really dumb? Hah probably!
    I would not dare call you dumb any help? http://forum.xda-developers.com/showthread.php?t=2691854 

  • Character counter does not display data on IE when counter is 0

    Hi,
    I am implementing a character counter in ADF using Javascript (referencing this http://www.oracle.com/technetwork/developer-tools/adf/learnmore/10-char-input-counter-169133.pdf).
    I display the string --> 'x' characters left
    The problem that I am facing is: when my character counter becomes 0 (can no longer enter any text, the maxlimit of the input field is reached) then on IE browsers, it does not show the character '0'. It displays a blank. On Firefox and Chrome, however, the UI gets displayed as expected i.e. 0 characters left.
    Can I get any pointers how to fix this on IE. Have tested with IE versions 7,8,9. JDev version is 11.1.1.5.0
    Here is the code snippet that I am using:
    Javascript:
    function showCharacterCount(event) {
    var keyCodePressed = event.getKeyCode();
    if (keyCodePressed == AdfKeyStroke.TAB_KEY
    || keyCodePressed == AdfKeyStroke.ARROWLEFT_KEY
    || keyCodePressed == AdfKeyStroke.ARROWUP_KEY
    || keyCodePressed == AdfKeyStroke.ARROWRIGHT_KEY
    || keyCodePressed == AdfKeyStroke.ARROWDOWN_KEY) {
    event.cancel();
    else {
    textfield = event.getCurrentTarget();
    textfieldValue = event.getSource().getSubmittedValue();
    textfieldLength = textfieldValue.length;
    textfieldMaxLength = textfield.getMaximumLength();
    o = AdfPage.PAGE.findComponent('characterCounter');
    characterCounterValue = o.getValue();
    characterCounterValue = textfieldMaxLength - textfieldLength;
    o.setValue(characterCounterValue);
    UI:
    <af:panelGroupLayout id="pgl3" layout="horizontal">
    <af:outputText id="characterCounter" clientComponent="true" value="325"
    inlineStyle="text-align:right; display:block; width:100.0px;"
    binding="#{viewScope.myBean.characterCounterBndg}"/>
    <af:outputText value="characters left" id="ot7"
    inlineStyle="padding-left:5.0px;"/>
    </af:panelGroupLayout>
    <af:inputText id="it2" rows="4" columns="53"
    value="#{viewScope.myBean.text}" maximumLength="325" clientComponent="true"
    simple="true">
    <af:clientListener method="showCharacterCount"
    type="keyUp"/>
    </af:inputText>
    Thanks in advance.

    Try converting from dynamic data, that seems to take care of the problem. Also, you could use the regular field point VIs instead of the FP express VI. Check out the attached VI.
    -Alan A.
    Attachments:
    FP_Read.vi ‏30 KB

  • Character Counter for ADF 11g RichTextEditor

    I am rewriting an application in 11g RichFaces. The original app had a text area that had a maximum allowable length and used a Javascript function to display to the user how many characters they had left as they were typing. In the new app, I have replaced this functionality with the WYSIWYG RichTextEditor, but would like to give them the same functionality that they had before. I would like to display, as they type, a character count. The count needs to be of the actual displayed characters, not the count of HTML characters that are generated behind the scenes by the RichTextEditor.
    Is this possible?

    huh? waking up a 1-year-old thread to ask an unrelated question (and a demand for us to write your code for you to wit)?

  • APEX_ITEM.textarea with character count in a SQL Report

    This seems like a simple question but where is the function to have APEX draw the textarea but with a maximum number of characters from within a SQL report.
    I am building a parameter entry form but the number of parameters is dynamic so my best option was to use a SQL based report. I have looked though the APEX_ITEM package and found the textarea function but there is no options to draw the version of it that limits character count. Is there a way to have it draw that textarea instead of the unlimited one. In my case I have a length limit that I must enforce.

    The only solution that comes to my mind is to use Javascript. Define a JS function in page header that will check the length of text in textarea and if it exceeds the limit then it will trim it.
    Then, when creating textareas using APEX_ITEM add paramater onChange="callToYourJSFunction()"

  • Character Counter for a Rich Text Editor

    Version  4.1.1.00.23
    Hello,
    I'm hoping that someone has a solution for a character counter/validation to use on the Rich Text Editor.
    Thanks,
    Joe

    Hi,
    Happy New Year.
    Ok.
    Well, I'm not expert on this, but this peace of code might help you get started.
    Code should go to page JavaScript -> Execute when Page Loads
    var lEditor=CKEDITOR.instances.Px_YOUR_EDITOR;
    lEditor.on('contentDom', function() {
    lEditor.document.on('keyup', function(e) {
    var len=lEditor.getData().replace(/<[^>]*>|\s/g, '').length;
      /* do here something. JavaScript valiable "len" holds editor text length e.g. */
    /* alert(len); */
    Replace Px_YOUR_EDITOR with your editor name.
    I do not have any idea does it work on all browser. I did test with Firefox.
    Regards,
    Jari

  • How do you get a word and character count of a document in Pages for Mavericks

    How do you get a word and character count of a document in Pages for Mavericks?

    Hi jonathan,
    I struggled with this one as well, as i'm finishing up a PhD thesis and word counts are incredibly important. Through trial and error i found out that words like 'e.g.' and 'i.e.' count as two words and an ampersand (&) doesn't count at all. That being said, i didn't like the fact that the word count always included footnotes and i was dismayed that i couldn't get an accurate count of words in the main body of my text. That all disappeared yesterday when, by chance, while i was copying a completed chapter and pasting it into my main document, i discovered that Pages can indeed give you an accurate word count excluding the footnotes!  Here's all you need to do:
    1. In pages 5.2, make sure that the Word Count function is first enabled by selecting View --> Show Word Count from the Pages Menu Bar. (If it's already enabled, it will read View --> Hide Word Count, so if that's what it says, then no need to do anything.)
    2. Once enabled, check the Word count that's currently showing at the bottom of the page. That's the word count including your footnotes.
    2. Now, place your cursor anywhere within the current document, then hit command+A (for Select All).
    3. Viola! Your word count now shows the actual number of words within the body of the text only, excluding footnotes!
    Hope that helps!

  • Character Count Variable

    Hi,
    Is it possible to set the 'chacters remaining' as a variable for Text area with c/count, this is because I have a comments field that is adding to a column that is already populated so the characters remaining will vary depending on what is already in the table
    I know its set in the max width of the elemant section but you cant seem to put a variable name in there.
    Thanks ANDY

    hey andy--
    you can't currently refer to session state values from the maxWidth field as you're finding. i've logged that as an issue, but you can work out your "characters remaining" request for now by calling our charCount jscript function from somewhere you can reference session state. to do so, take a look at the html that's generated when you use those "Textarea w/Character Counter" item types. you'll see that the form element has a jscript call in it that looks something like...
    onKeyUp="javascript:charCount('P3_MY_TEXAREA',255,'tAreaCtr8','tAreaMax8','theBlock8');" onChange="javascript:charCount('P3_MY_TEXAREA',255,'tAreaCtr8','tAreaMax8','theBlock8');"
    ...and you'll see a div and span combo right after it that looks something like this...
    <div style="font-size:8pt;visibility:hidden;" id="theBlock8"><span id="tAreaCtr8"></span> of <span id="tAreaMax8"></span></div>
    ...so you could put code similar to this into a regular TextArea item to call our charCount function while passing it the dynamic value. to do so, you'd put your div/span combo in the "Post Element Text" section of your TextArea item. you'd then want to call charCount by passing it the dynamic value. unfortunately, you can't just put that call into the "HTML Form Element Attributes" because that field currently doesn't support session state references. instead, you'd have to put in a call to a function of yours that calls our charCount. so a call like this...
    onKeyUp="javascript:callCount();" onChange="javascript:callCount();"
    ...just worked in my test case. i defined my callCount funtion in the "HTML Header" field of the page-level atttributes screen as...
    <script language="JavaScript1.1" type="text/javascript">
    function callCount(){   
    charCount('P3_MY_TEXAREA',&P3_X.,'tAreaCtr8','tAreaMax8','theBlock8');
    </script>
    ...and, as you can see, it just calls callCount while passing it my dynamic P3_X value instead of the fixed maxWidth one. having said all this, it's still our recommendation to not directly call the javascript functions that ship with htmldb. we reserve the right to change how those "internal" calls are implemented. to play it absolutely safe, you'd be better off to copy our charCount function into your app (presumably in a .js file) and call that copy using the same work around i specified above.
    hope this helps,
    raj

  • Textare with character counter versus textarea with html editor

    Hi
    I am using a textarea with html editor. I need to restrict the user to not type more than 25000 characters? Can someone tell me as to how I can do that?
    I know that one can set the maximum width for textarea with character counter and it prevents one from typing in more than the maximun specified, but I really need to use the html editor. Thanks.
    suni

    This is caused by the charCount javascript function, which dynamically sets the text colour to 'red' when the maximum number of characters is entered, but "resets" it to 'black'.
    Guess the way to avoid this is to create your own equivalent of the charCount function that captures the actual colour from the DOM and attach it to a textarea using the onchange and onkeyup attributes used in the built-in one.

  • Word counts and character counts

    Hi,
    I'm using Pages '06. I would like to be able to count the number of words and characters in a paragraph in Pages. I know that if i go to the Document Inspector and click info, it gives me word and character counts for the entire document. Is there a way to do this for individual paragraphs?
    Many thanks.
    Joe.

    After you install WordService (see link in Dennis' post), you can access several new services in the Pages menu. You may have to restart Pages &/or your Mac.
    WordService & CalcService add their functions to any OS X program that has been programed to utilize Services. I've been using them since shortly after I got iWork '05.

  • Textarea w/character counter problem

    Hi!
    We use a textarea with character counter and limited its max width to 500 chars. If max 500 chars have been inserted, then input stops after 500 chars. That works fine in MS Internet Explorer. Even if you insert CR/LF inputs (ENTER button), the max number of typed in chars will not exceed 500. Using Mozilla Firefox, it is possible to insert many CR/LF, which increases the typed in number by 2. Thus you get e.g. "548 of 500" displayed beyond the textarea. After updating the page in IExplorer even here you get the same counter status displayed. As long as you do not type in the textarea field, the char counter remains as it is and the data can be submitted and finally stored in database.
    Qu: Has anybody experienced teh same problem with max chars and CR/LF. Any idea of a workaround prevent "548 of 500" in textareas when typing in CR/LF ?
    Br,
    Thomas

    The CharCount() function that is used by APEX should be updated to contain javascript code similar to the code described here:
    http://pikasoftware.com/docs/index.php/Validating_TextArea

  • A character counter in a TextArea

    Our friend Mário is requesting the following:
    "I would like to create a character counter in a TextArea with real time actualization, I only could do it after call an action (button), I would like that this happens in real time with the user typing and the counter being refreshed automatically."
    If somebody can help him, please post.
    Marcelo

    Hi Mario,
    what u would like is a Javascript function which monitors whitespaces and determines to add a counter for each line on the enter key
    it would be activated onclick and on change of the control
    with respect,
    amit

  • Report TEXTAREA character counter

    A textarea field has a "Maximum Width" and a Character Counter.
    How can I create Character Counter for a textarea field in a report (SQL Query (updateable report))?
    Edited by: Rob-9100-NL on 28-jun-2012 4:13

    Denes,
    My little bit different function: (one parameter less and no longer extra field for length in the select):
    function f_set_counter(pConterID,pTextId,pMaxLength)
        var pLength = $x(pTextId).innerHTML.length;
        if (pLength>pMaxLength)
         {alert('Dit veld mag niet meer dan '+pMaxLength+' tekens bevatten.')
          $x(pTextId).value=$x(pBron).value.substring(0,pMaxLength)
          {$x(pConterID).innerHTML = pMaxLength}
        else    
         {$x(pConterID).innerHTML = pLength}
    }In the HTML Expression of the text field:
    <textarea id="f06_#ROWNUM#" wrap="VIRTUAL" cols="80"
    rows="5" name="f06" autocomplete="off"
    onkeyup="f_set_counter('f06_#ROWNUM#_CHAR_COUNTER', 'f06_#ROWNUM#',500)"
    #PA_AANTEKENINGEN#</textarea><br/>
    <span id="f06_#ROWNUM#_CHAR_COUNTER"></span>
     van 
    <span>500</span>
    </div>
    <script type="text/javascript">
      f_set_counter('f06_#ROWNUM#_CHAR_COUNTER', 'f06_#ROWNUM#', 500);
    </script>Now I do get the "0 van 500" on a new record.
    Regards,
    Rob
    Edited by: Rob-v-M-Gn-Nl on 26-jul-2012 4:29

  • Asian character count

    I am in the process of evaluating pages, numbers etc. with a view to removing microsoft office from my computer.
    I am a translator, and a function I use regularly is to count characters. Many documents contain both English and Japanese text, and I need information on how many of the characters in the document are Japanese. This shows up usefully in the internationalized version of word as Asian characters and non-asian words so I can see exactly what I am dealing with.
    How do I get pages to return similar information? All it currently tells me is that there are, to give an actual example for clarity, 13,550 words and 25453 characters, which is actually quite meaningless in a case like this. The information I need is (using the same example in word) 617 Non-Asian words, 16,887 Asian characters.
    I am using the evaluation copy of pages that was bundled with Lion, do I perhaps have to internationalize that in some way (it already inputs and displays Japanese OK as I have that already se up on my system but I am wondering if the application needs other stuff doing to it to be able to return the more detailed statistical inormation - as office does).
    Thanks to anyone who knows!
    Sean

    Sean Brophy wrote:
    it doesn't seem to me like a particularly cumbersone task
    You can let Apple know here:
    http://www.apple.com/feedback/pages.html
    It looks to me like OpenOffice does not have Asian character counting, so it may well be that Word is the only app for that.  It is definitely the app of choice for vertical text and phonetic guides as well.

  • How do I limit the character count in a text field?

    I'm creating a form for co-workers to use when creating web content. I need to restrict their character count for items like headlines, titles, subtitles, etc. Any suggestions on a ready-made form to use out there? And how can I limit those fields so they don't generate content that will then need to be edited down?
    Thanks,
    EAW

    Check out this post:
    http://forums.adobe.com/message/4364378
    Randy

Maybe you are looking for

  • Propagating an event to the cell renderer

    Hi All, I have a JTable cell which renders the value object in two separate Text Fields. So the table cell appears to have two text fields. I want to popup a dialog when the user clicks on one of those text fields. Not sure how to implement this. Tha

  • Is there anyway to keep the Lightning charger from breaking?

    Is there anyway to keep the Lightning charger from breaking? I've gone through 8 of these in less than 5 months. When I take it apart it looks like where the wires are connected to the actual lightning plug it is a very flimsy soldering job. It looks

  • Aggrates after compression

    hi,      here is my scenario:i have a cube with data of 2010,2011,2012,2013,2014,every time we load the data into cube data is compressed after some time Client asked me  to create an aggregate on 2012 data ? how can we create aggregates in this scen

  • Find physical patch for diskgroup in ASM

    Hi Experts, We have a RAC database 10..20.4 in ASM in redhat system. there are two diskgroup as data1 and  fradisk1 all of database backup files locate at fradisk1 diskgroup. Sys admin wants to copy ASM data into tape for system backup and ask me phy

  • Proforma Invoice configuration/ assignment

    Dear SAp guru's     I have done the assignment of F5 and F8 to my sales document - i am not able to get the proforma output, whether i have to assign the output for this billing document or to the sales order, delivery - i am confused and i am not ge