How to use find substring in spark with regex

150 views
Skip to first unread message

nickname

unread,
Jun 26, 2012, 7:28:25 AM6/26/12
to spar...@googlegroups.com
Hi , 
Is it possible to check if a string contain a word in spark view engine?
for instance ,Is there any regex thing that can help me to find "test" in below string :
"this is a test string"

thank you

Rob G

unread,
Jul 7, 2012, 2:53:29 AM7/7/12
to spar...@googlegroups.com
Hi Amir,

I see this was asked a while ago, and I've been away. Did you figure this out? Also, do you need Regex or just string.Contains()?

Rob

--
You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spark-dev/-/Fzxtym7aL9wJ.
To post to this group, send email to spar...@googlegroups.com.
To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spark-dev?hl=en.

nickname

unread,
Jul 7, 2012, 5:33:11 AM7/7/12
to spar...@googlegroups.com
HI Rob,
No difference , I am looking for any possible solution to find a substring in a string.
tanx


On Saturday, July 7, 2012 7:53:29 AM UTC+1, RobertTheGrey wrote:
Hi Amir,

I see this was asked a while ago, and I've been away. Did you figure this out? Also, do you need Regex or just string.Contains()?

Rob

On Tue, Jun 26, 2012 at 12:28 PM, nickname <ina...@gmail.com> wrote:
Hi , 
Is it possible to check if a string contain a word in spark view engine?
for instance ,Is there any regex thing that can help me to find "test" in below string :
"this is a test string"

thank you

--
You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spark-dev/-/Fzxtym7aL9wJ.
To post to this group, send email to spar...@googlegroups.com.
To unsubscribe from this group, send email to spark-dev+unsubscribe@googlegroups.com.

Rob G

unread,
Jul 7, 2012, 5:45:44 AM7/7/12
to spar...@googlegroups.com
If you could give more context to how you'd like to use it, that may help give a better solution.

Does this work for you?

<var someString="this is a test string" />
<viewdata stringFromViewData="string" />

<div if='someString.Contains("test")'>This will render if true</div>

<div if='stringFromViewData.Contains("test")'>This will render if true</div> <!-- you can use C# code inside the if attribute -->


Cheers,
Rob

To view this discussion on the web visit https://groups.google.com/d/msg/spark-dev/-/zupIjHexUxMJ.

To post to this group, send email to spar...@googlegroups.com.
To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.

nickname

unread,
Jul 17, 2012, 6:26:31 AM7/17/12
to spar...@googlegroups.com
thank you very much
Reply all
Reply to author
Forward
0 new messages