|
Page
1
of about
1
First
| < Prev
| Next >
| Last
|
Messages in Topic
|
Hello,
I am trying to uppercase the first letter of each word in a text input from the user and to replace the " " by "_". For example, if the user enters "You like Iron man" I would like to get "You_Like_Iron_Man". I think I should use a string regex module but I can't figure out what to replace with what... http://pipes.yahoo.com/pipes/pipe.info?_... Thanks if you can help me ! Rating :
![]() ![]() ![]() ![]() (No ratings) |
![]()
21/Male |
|
To replace a space with an underscore you can use the String Replace module with the "every" option selected.
To uppercase the first letter of each word is a completely different kettle of fish. To a limited extent I think it's possible, but the process would be very convoluted. It seems to me that your example pipe is a very artificial example. If you supplied a real example we might be able to suggest a reasonable solution. Rating :
![]() ![]() ![]() ![]() (No ratings) |
![]()
58/Male |
|
Ok thanks !
My real example might involve some torrent sites among many others... and as the use of it might be questionnable I don't want anyone to feel bad about it :) Rating :
![]() ![]() ![]() ![]() (No ratings) |
![]()
21/Male |
|
Fair enough.
I'll work on the basis that you want to filter on the string entered, so we have our "I like spaghetti" string. I've already mentioned the String Replace module, so then we have "I_like_spaghetti". The feed has 3 items with the titles I_Like_Spaghetti I_Like_Spaghetti_Westerns I_Like_Chips If we want to select the first 2 items, then we can use a Filter module and the "Contains" operator on our string as it stands. If we want to select only the first item, there is a little more work to do. Basically the idea is to convert the titles (or rather copies of them), to all uppercase, and do likewise for the input string and then use a filter on those. After the String Replace use a String Regex module with a rule to replace "(.*)" with "\U$1". With the feed use a Rename module to copy item.title to, say, "uptitle". After that use a String Replace module within a Loop, select item.uptitle for both input and result and use the same rule as before. We can then use a Filter module to filter item.uptitle using the "Is" operator. Rating :
![]() ![]() ![]() ![]() (No ratings) |
![]()
58/Male |
|
Page
1
of about
1
First
| < Prev
| Next >
| Last
|


