<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div><div class="im">>2- the .found necessary to get the result could be hidden with a two-levels template:<br></div><div class="im">>auto s = substring!("fun with gun", "run");<br></div>I try to comply to the style of std.metastrigns, they do not do it there.</div>
<div></div></div></div></blockquote><div><br>They do that for parsing, because you have to 'return' both the value and the rest and you can't do both the eponymous trick and declare another '.something' at the same time. <br>
Format becomes the formatted string without an intermediary '.format'<br>For substring, I think a boolean is the only thing you want. But you may want to return the rest also. ie, your template consumes the string until it founds the substring.<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div>And when I see "auto s = substring!("fun with gun", "run");" I presume s is substring, not</div>
<div>boolean.</div>
<div></div></div></div></blockquote><div><br>Yeah me too at first sight, but then you already know the substring: it's "run"...<br>You could call it "contains": auto c = contains!(bigstring, smallstring);<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div style="font-size: 12pt; font-family: times new roman,new york,times,serif;"> </div>
<div style="font-size: 12pt; font-family: times new roman,new york,times,serif;">I would like to hear if people think that substring deserves to be in std.metastrings. Otherwise all this discussion is pointless.</div><br>
</div></div></blockquote><div>You may not have many answers there: they are all rushing to finish D and the most important librairies like std.concurrency.<br>You'll have to wait 1-2 months to have them look elsewhere.<br>
<br>Anyway, what usage do you see for substring?<br><br> Philippe<br><br></div></div>