Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] How to replace text in a string with clipcode?

Expand Messages
  • Sherry
    Hello, Thank you so much, EVERYONE, for answering my request. I am sorry for not responding earlier. But I did read the discussion and finally today I am in
    Message 1 of 12 , Aug 22, 2010
    • 0 Attachment
      Hello,

      Thank you so much, EVERYONE, for answering my request. I am sorry for not responding earlier. But I did read the discussion and finally today I am in the need of the code.

      Again, I am sorry for not communicating earlier, requiring you to read my mind ;)

      I picked this code below, and, having inserted it into my HTML.clb library, it works like a charm. (Had to get admin privileges to add/modify the library). That is exactly what I wanted. Someday when I need more, I will study the code and modify if needed.

      I really appreciate the responsiveness of everyone in the group, you guys rock! There is something very satisfying to have a simple code do wonders with my text ;)

      Greetings, and have a great rest of the weekend!

      Sherry

      --- In ntb-clips@yahoogroups.com, hsavage <hsavage@...> wrote:
      >
      > Sherry wrote:
      > > It's funny, I have worked with NoteTab Pro for a month and still
      > can't find a tutorial for Clipcode! A simple Hello World type code
      > tutorial? I'd like some hints for that! Not just a pointer to a file
      > full of complicated clipcode. Maybe a short 5 min video tutorial with
      > a simplest of all examples? Just a suggestion.
      > >
      > > My question is: How do I write a clip code that will replace all
      > occurrences of _ with a space and then capitalize all words?
      > >
      > > for example
      > >
      > > "aa_bb_cc_dd_ee" should be replaced by "Aa Bb Cc Dd Ee"
      > >
      > > or maybe not replace in a string, but instead replace within a
      > highlighted piece of text.
      > >
      > > Replacement in place is fine.
      > >
      > > Thanks in advance! I feel clipcode is a really valuable concept
      > but extremely tough to crack into! For example, I am proficient with
      > Xemacs macros, and they are easy to define.... at least for me!
      > >
      > > Thanks again! Sherry
      >
      > Sherry,
      >
      > Reg-exp has been pretty well covered for your problem. Here's a
      > simple clip language method to resolve your request.
      >
      > It does nothing more or less than you asked with your example. I
      > hope you can copy and paste this into a library to use, if you don't
      > know how reply back to this clips list.
      >
      > ----------------------------------
      > H="Replace Underscore & Capitalize"
      > ;_WITHOUT REG-EXP
      > ;_
      > ^!If ^$GetSelSize$ = 0 NEXT ELSE SOMETHING_SELECTED
      > :NOTHING_SELECTED
      > ;_With nothing selected this 3 line group executes whole document
      > ^!Replace "_" >> " " TWSA
      > ^!Select ALL
      > ^!GoTo END
      > ;_
      > :SOMETHING_SELECTED
      > ^!If ^$GetSelSize$ > 0 NEXT ELSE END
      > ;_With selection made these last 2 lines execute on selected text
      > ^!Replace "_" >> " " THSA
      > :END
      > ^$StrCapitalize("^$GetSelection$")$
      > ------------------------------------
      >
      > ·············································
      > ºvº SL_day# 226 - created 2010.08.14_17.15.01
      >
      > Party Etiquette; Drinking Your Fair Share.
      >
      > € hrs € hsavage € pobox € com
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.