SubString function
Hi,
first let me thank you for the only chrome extension which offers so wide "web-clipboard" functinality. It's useful.
However if you will think about new functionality, please consider string functions. I.e. I need to shorten title:
"User Story US5477: As tools software engineer, I want to ensure t... | Rally"
... to "US5477"
"Defect DE1327: iTest crashes on start, then it continues to work | Rally"
... to "DE1327"
"SubString(startIndex, length)" would solve my problem. Optionally "IndexOf(char value)" and "Length()" would make it perfect.
With best wishes,
Robert Polomsky
As I’ve stated in a previous comment; this is a great idea but cannot be implemented (or cleanly, at least) due to the syntax of template system (i.e. Mustache).
-
Timothy commented
I'm not familiar with the code at all. Is there some way you could parse the string and chop off everything after a given variable? In Robert's case could he cut off everything after the colon leaving just Defect DE1327? I have a similar use-case in mind.
-
Adminneocotic (Owner, Template) commented
Hi Robert,
This is a great idea and I'd love to be able to add this functionality. However, the template system (which is a customized version of Mustache) does not support functions in this sense.
Operations - as I have chosen to call my template functions - can only take a single argument, and is whatever the contents of the tags are rendered to. Where something like {#length}foo{/length} could work (resulting in "3" being rendered), it would useless without the other functions you've mentioned.
Since operations are not called in the context of a string, that string would have to be passed as an argument also (e.g. {#indexOf}foo{/indexOf} - no room for lookup string argument).
Once again, it's a great idea and I would have loved to have added it, so please keep up the great suggestions.