Agentry First letter uppercase rule

Hi,
is there a (not too complex) way to convert an uppercase string to a string where only the first characters of the words are upper case?
The field contains multiple words and every word should begin with a capital.
There are only string rules for all uppercase or all lowercase strings..

Hi Dieter,
This can be done using the JAVASCRIPT function. You can write javascript code to do the work and call that code from within an Agentry rule.
For example, the following rule (paste into your editor) is using the Javascript code on the City property  to make the first characters of the words uppercase and the rest lowercase.
(@JAVASCRIPT ((*argv[0].toLowerCase$28$$29$.replace$28$ /$28$^|\s$29$$28$[a-z]$29$/g , function$28$m,p1,p2$29${ return p1+p2.toUpperCase$28$$29$; } $29$;)) :>12"City")

Similar Messages

  • Uppercase first letter of every new sentence

    Hi Guys,
    I am working on a design for a magazine for which, at the moment, I need to type a lot of the texts in InDesign instead of copy-pasting them from word or...
    This made me a little annoyed since I don't get to uppercase each first letter of each sentence automatically like Word etc. do?
    So: how can I automatically uppercase the first letter of each new sentence?
    Many thanks,
    Bob

    Unbelievable that I only found this now and that it is that simple!
    Thanks!!

  • Converting first letter of word to uppercase

    Hi,
    Is there any function module to convert the first letter of the word to uppercase ?
    --bala

    Hi
    This will convert only the first word. If i have to do for all the words, like.,
    twinkle twinkle little star
    to
    Twinkle Twinkle Little Star.
    --bala

  • Regular Expression - uppercase the first letter.

    I'm trying to process a String so that sentences without a starting capital letter have that letter made uppercase. The code I have so far is:
    import java.util.regex.*;
    public class TestRegexp{
         public static void main(String[] args){
              String myString = new String("Hello. capital");
              // TODO: Fix this so that it does uppercase the first letter
              String pattern = new String("\\.\\s+\\w");
              Pattern r = Pattern.compile(pattern);
              Matcher n = r.matcher(newString);
              String newString = n.replaceAll("\\. " + "\\w".toUpperCase());
              System.out.println(newString);
    I want the output to be:
    Hello. Capital
    But this doesn't work. Is there a way to do this using the java.util.regex library and thus avoiding the StringTokeniser route?
    Thanks.

    The regex package doesn't provide a direct way to do what you want, but you can manage it by using some lower-level methods of the Matcher class:
    Public String capitalizeSentences(String str)
      Pattern p = Pattern.compile("(\\.\\s+)(\\w)");
      Matcher m = p.matcher(str);
      StringBuffer sb = new StringBuffer();
      while (m.find())
        m.appendReplacement(sb, "$1");
        sb.append(m.group(2).toUpperCase());
      m.appendTail(sb);
      return sb.toString();
    }

  • Uppercase the first letter in a selectedtext() in a jtextfield

    Hello,
    I want to uppercase the first letter of the selected text in a jtexfield.
    I tried :
    StringBuffer stb = new StringBuffer(textField.getSelectedText());
    stb.setCharAt(0, Character.toUpperCase(stb.charAt(0)));
    but it doesn't work
    can anyone help me ?
    thanx in advance

    Well that function shows some bugs then I replace it with this one usins the text area reaplace slected text as camickr said (thanx camickr) and the position of the cursor.
    here is the new function :
       * Capitalize the first letter of a selectd string
       * but leave the rest as they are.
      public void capitalizeFirstLetter() {
        //get selected text
        selectedText = textArea.getSelectedText();
        try {
          //String buffer to change the case of a letter in a given index
          StringBuffer stb = new StringBuffer(selectedText);
          //Capitalize the first letter of the selected text
          stb.setCharAt(0, Character.toUpperCase(selectedText.charAt(0)));
          //Repalce the selected text with the same but with first letter capitlized
          textArea.replaceSelection(stb.toString());
          tableModel.setValueAt(stb.toString(),
                                sorter.modelIndex(this.getSelectedRow()),
                                findColumnIndex());
          //Renew Selection
          textArea.setSelectionStart(textArea.getCaretPosition() -
                                     selectedText.length());
          textArea.setSelectionEnd(textArea.getCaretPosition());
        catch (Exception ex) {
          JOptionPane.showMessageDialog(null,
                                        "No Selection found, plese select some text before apply this",
                                        JOptionPane.WARNING_MESSAGE);
      }

  • Change only first letter to uppercase

    Hello,
    Have a way in graphical mapping to change only the first letter to uppercase?
    Elad

    hi,
    Please do the following mapping. hope this will help you.
    input-->SUBSTRING1>uppercase-->Firstinput to concate function
                                                                    CONCATE----
    >output
                      input-->SUBSTRING2--->second input to concatefunction
    Set Substring1: starting position=0 and numberof chareters =1
    set Substring2 :starting position=1 and numberof chareters =0
    regards
    Kasturika

  • First letter MUST be uppercase

    Hi there!
    Nowadays trend is to write everything in lowercase. Last
    Names, First Names, City Names, etc...
    Maybe the use of computers is one of the reasons to such bad
    typing.
    In a form, there's a lot of Input Fields to fill-in...
    Is there a way in AS to make the first letter typed in an
    uppercase one?
    I thank you in advance for the help you'll provide.
    Best regards,
    Gerry

    quote:
    Originally posted by:
    Rob Dillon
    You can assign a listener to each of the input textfields and
    then use a function to change the first character to upper case
    using the toUpperCase() method.
    Thank you for replying!
    Alas, this doesn't work...
    Maybe I missed something...?
    Did you tried it is a simple .fla?
    I did.

  • Uppercasing first letter

    I'm trying to standardize the names in my report, to just uppercase the first letter, but I get an error, it doesn't seem to like the -1. Maybe there's a simpler way to do this...
    upper(left(Contact."Contact First Name" ,1)) || right(lower(Contact."Contact First Name"), length(Contact."Contact First Name") - 1)

    Hi, instead of Right() you can also use the substring argument to get the second part, your formula will look like this:
    upper(left(Contact."Contact First Name" ,1)) || lower(substring(Contact."Contact First Name" from 2))
    Regards, Tim

  • How do you change the first letter of a new line from uppercase to lowercase?

    In filling in case sensitive id's and passwords, the iPad automatically capitalizes the first letter---how do you change to lower case?

    You can shut off Auto Capitalization in the settings to prevent that from happening.  Go to Settings>General>Keyboard>Auto Capitalization>Off.
    You can change to lower case manually by tapping the "black X icon in the arrow" in the upper right corner of the keyboard to delete the capital letter and then type in the lower case letter.

  • Lowercase first letter in column name of non-interactive report

    I have a report from this query:
    SELECT DISTINCT
    v.isotope, v.location,
    v.activity_in_ucuries as "uCi"
    FROM inventory v
    where v.location = 'IN PROCESS'
    and v.activity_in_ucuries > 0
    Note 'as "uCi"' - when the report displays the lowercase u is displayed as an uppercase U
    In the column attributes , I have set the column heading as lowercase. In the report attributes I have Heading Type set as custom
    and the column heading shows lowercase. I have also tried using the a heading type of Column Names. With all of these changes the
    report still comes out with an uppercase U.
    Is there a way to prevent the automatic set of the first letter to Uppercase or alternatively, force the first letter to lowercase?
    Thanks
    Donna

    I am using theme 13. I don't have any experience changing the templates, so the report template has the following in Column Headings:
    <th#ALIGNMENT# id="#COLUMN_HEADER_NAME#" class="t13ReportHeader">#COLUMN_HEADER#</th>
    Can I make a change in here to prevent the transformation of the 1st character to uppercase? (I would also love to change the u to mu!)
    I do have a test application in theme 3 that seems to preserve whatever case I enter it in...I suppose I can change themes, but I would like to stick with theme 13 if possible.
    Thanks for any additional help.
    Donna

  • Lowercase first letter in column name of non-interactive report..Again

    A couple of days ago a posted a question on how to make the column name in a non-interactive report
    come out as lowercase. (original post: Lowercase first letter in column name of non-interactive report
    I am using Theme13, which is probably the only theme that forces the first letter
    of a column name in a report to uppercase.
    Anyway, I received several responses including the answer which I applied to my page.
    Then I went back to make the column sortable and that negates the CSS override and
    the first letter in the column name is back to uppercase...arrrggghhh!
    Are there any further suggestions on how to force this to lowercase with theme 13 and a sortable column?
    Thanks
    Donna

    Hi,
    Try style to page HTML header
    th.t13ReportHeader,th.t13ReportHeader a:link,th.t13ReportHeader a:visited{
    text-transform:none!important;
    }Br,Jari
    Edited by: jarola on Feb 4, 2010 8:00 PM

  • Making the first letter of every word a capital

    hello CF oracles
    could you guys please advise me the best way to make the
    first letter in every word of a string a capital letter. (and make
    all the other letters lower case).
    eg. convert "the quick brown fox" into "The Quick Brown Fox"
    or convert "THE QUICK BROWN FOX" into "The Quick Brown Fox"
    I am taking form data and inserting it into my table, so i
    want to get it right as the data is inserted.
    i found a "UDF" on CFLIb.org that proports to do this, but i
    don't know how to set up a UDF, are there other ways or is this
    considered the best approach.
    http://www.cflib.org/udf.cfm?id=9&enable=1
    thanks for any help you can give me

    found it, here's the top info, Titlecase is what you want for
    this.:
    changecase.cfm
    Rev 1.01
    cf_changecase is a simple custom tag to format case in given
    string.
    (c) 2001, Rizal Firmansyah, [email protected]
    Input var:
    * case (mandatory)
    possible inputs are
    - sentencecase: Sentence case (default)
    - titlecase: Title Case
    - lowercase: lowercase
    - uppercase: UPPER CASE
    "happysailingdude" <[email protected]> wrote
    in message
    news:e46tjv$e30$[email protected]..
    > hi Dan thanks very much. I have made an executive
    decision to do a bit of
    > a
    > hack for now as my site is only small so if a user
    enters something in the
    > wrong way i can quickly manually update it myself.
    >
    > so now i have this which works 9 times out of ten if the
    user enters a one
    > word name eg "bill" or "fred" of "jane" then it works
    just fine
    >
    > the only time it doesnt work is if the user's name is
    more than 1 word (or
    > is
    > hyphenated) eg "mary anne" or "anne-marie" hence the
    first cfif line - in
    > these
    > cases i can manually update
    >
    > i put this here in case it is of use to anyone else
    >
    > cheers
    >
    > <cfif not (FORM.firstName contains " " or
    FORM.firstname contains "-")>
    > '#Left( UCase( "#FORM.firstName#" ), 1 )##Right( LCase(
    > "#FORM.firstName#" ), Len("#FORM.firstName#" ) - 1 )#'
    > <cfelse>
    > '#FORM.firstName#'
    > </cfif>
    >

  • How to Capitalize the first letter in a text field?

    I have a text field of first_name and one of last_name.  I want to make sure not matter what format the user inputs the the first letter is Capitalized and the rest is lower case.  Can someone tell me how this is done?  Thanks!

    Rick4209 wrote:
    I have a text field of first_name and one of last_name.  I want to make sure not matter what format the user inputs the the first letter is Capitalized and the rest is lower case.  Can someone tell me how this is done?  Thanks!
    It depends on what you want to do with the name. If this is for inserting the name in a database and you're using PHP, it's very simple:
    $name = 'DaVID';
    $formatted = ucfirst(strtolower($name));
    echo $formatted; // outputs 'David'
    This nests two functions: the inner function, strtolower(), converts everything to lowercase, and the outer function, ucfirst(), converts the first letter to uppercase.

  • Styling first letter in each line differently [was: Dreamweaver cs4 question]

    I am trying to change the font in a group of text, I want to change the first letter of each sentence to a large size and different color and when I do this it changes the entire  paragraph in the div, so how can I change the attribute of one letter in a word? Example: See how the first letter of each sentence spells out earth?  I want to make those letters to stand out.  CAN ANYONE TELL ME HOW TO DO THIS??????
    Ensuring compliance with relevant environmental legislation and regulations.
    Achieving and reviewing our set objectives and goals with continual improvements.
    Reducing environmental pollution by reducing, recycling and re-using by-products and waste.
    Training and communication to all our staff to participate and achieve environmental excellence.
    Having our environmental policy documented, implemented, maintained and made available to the public and interested third parties.
    Thank you in advance
    [Subject line edited for clarity by moderator]

    Your question went unanswered for nearly a day because of the meaningless subject line you used. Please take a moment to read How to get help quickly.
    There are a couple of ways to achieve what you want. The way I would do it is to make each line a separate paragraph, and wrap them in a div with an ID called "earth". The following CSS style rule will make the first letter of each paragraph 24px tall and green:
    #earth p:first-letter {
      color:#090;
      font-size:24px;
    This uses the first-letter pseudo-element and applies it to all paragraphs in the earth div.

  • First letter of each sentence in pages!

    how can I fix the first letter in each sentence, it doesn't turn to uppercase automatically, although i have tryed to choose none, title case etc. in the advanced setting? what should i do?

    We guess you are talking about Pages 5. You didn't say.
    Feature dropped by Apple along with 100 others.
    Pages '09 can capitalise the first letter of sentences automatically.
    Peter

Maybe you are looking for

  • Error while printing invoice

    hi sapiens,         the following error happens while printing my form from vf02.i have edited standard script rvinvoice01.i have not deleted any window.i have not even deleted text elemnts from the main window. what could be the problem . cancel err

  • How to stop application folder form disappearing from the dock

    I'm on MAC OS 10.6.7 on my Macbook 7.1.  My applications folder disappeared from the dock.  I can drag a new copy from the Mac Hard Disk folder to the dock (to the right of the dashed line (my dock is at the bottom) and it appears with an Address boo

  • Some usual questions from Yosemite..

    1 >> Startup and Shutdown slower than Mavericks even my Yosemite is install after erase the local hard drive! Why? 2 >> How to remove the Progress Bar during Startup and Shutdown in Yosemite? 3 >> Where is the "Title Bar" on Safari 8? I can't see the

  • STO Scenarion with - Ve cost as custom duty

    Hi, I have created a condition type let say X1, I am doing a STO scenario, from Plant A100 to Plant A101 in company Code A001 Now requirement is use condition type X1  for values as - ve as well as +ve depending on situation. I am able to do so, by c

  • Digital Picture Frame- Some images are saying "Not Support"

    Hello there, I recently purchased the Digital Picture Frame (DPF 10") for a gift. As I was setting it up by placing some photos on it with my USB drive. Some of the photos worked, while the others had a black screen that said "Not Support". I read so