Concat

72 views
Skip to first unread message

ADV

unread,
Mar 30, 2010, 10:35:11 AM3/30/10
to DotLess (Less Css for .NET)
Hi again....

For example I have @ImagePath variable and image name Immg.jpg.

How can i concat them in obe string?

Accuraty

unread,
Mar 30, 2010, 11:22:32 AM3/30/10
to DotLess (Less Css for .NET)
This is a great idea. If it is not already in the current feature set
or planned, then it should be.

It would be nice it the Operators handled it for now, basically just
use the plus sign to concat strings. If using '+' complicates things
in some way then '&' or something else borrowed from whatever language
the syntax most follows/emulates so far.

Not to change the subject, but... where do we post/submit feature
requests, wishlist ideas, etc?

Julian Birch

unread,
Mar 30, 2010, 11:51:57 AM3/30/10
to dot...@googlegroups.com
I think the new format function should solve your problem. :)

> To unsubscribe from this group, send email to dotless+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
>

ADV

unread,
Mar 30, 2010, 11:56:21 AM3/30/10
to DotLess (Less Css for .NET)
Can you show example? I don't understand u...

> > To unsubscribe from this group, send email to dotless+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.- Скрыть цитируемый текст -
>
> - Показать цитируемый текст -

Accuraty

unread,
Mar 30, 2010, 12:06:30 PM3/30/10
to DotLess (Less Css for .NET)
Julian, if you are talking about functionality like string.format()
in .NET, then yes, that would be awesome!

> > To unsubscribe from this group, send email to dotless+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.- Hide quoted text -
>
> - Show quoted text -

Accuraty

unread,
Mar 30, 2010, 12:08:53 PM3/30/10
to DotLess (Less Css for .NET)
Here is a (hopefully) simple and logical example:

@skin_path: '/Portal/0/'Skins/MCT2010/';
@image_path: @skin_path & 'css/image/';

#header {
color: white;
background: url( @image_path & 'header-nice.png') top left
#default['background-color'];
}

> > - Показать цитируемый текст -- Hide quoted text -

Julian Birch

unread,
Mar 30, 2010, 12:10:14 PM3/30/10
to dot...@googlegroups.com
Hi, bear in mind this is being typed on an iPhone... :)

a { x : format("{0} {1}", "hello", "world") }

should give you

a { x : hello world }

J

ADV

unread,
Apr 8, 2010, 2:47:06 AM4/8/10
to DotLess (Less Css for .NET)
Well, i see no answer today but is their any plans to support string
concatination?

Now dotless core doesn't crashes on such syntax:

@var: "hello";

a
{
background: url(@var + " World!");
}

to:

a
{
background: url("hello World!");
}

I just add replacing string " + " to string.empty and it's ok now,
it would be great to concat several times in future and i hope you
will support it.

Julian Birch

unread,
Apr 8, 2010, 3:19:03 AM4/8/10
to dot...@googlegroups.com
Try using format to achieve this. :)

> --
> To unsubscribe, reply using "remove me" as the subject.
>

Daniel Hölbling

unread,
Apr 8, 2010, 8:09:08 AM4/8/10
to dot...@googlegroups.com
It's already possible using the format function.
It works like the .NET format function so you can call it with:

format("{0}{1}", "string1", "string2") 
to get a concatenated string "string1string2" 

greetings Daniel

James Foster

unread,
Apr 8, 2010, 8:20:50 AM4/8/10
to dot...@googlegroups.com
I think the name of the format function needs to change.

Apparently, the following is valid css...

@font-face {
  src: local(Futura-Medium), url(fonts.svg#MyGeometricModern) format("svg");
}

whereas format("svg") would be evaluated as svg

What do you suggest we rename it to?

Accuraty

unread,
Apr 8, 2010, 8:24:12 AM4/8/10
to DotLess (Less Css for .NET)
As a developer and SQL guy of 20 years, the addition of format() is
fantastic and deserves high praise. But CSS is a non-developer thing
primarily. Though the syntax is simple enough, it is still...
"developerish." I encourage you to ALSO add the concat abilities as
described in the previous examples and requests. If it is already
planned and I am just somewhat oblivious to those plans, then please
forgive this message/request. Thanks - Jeremy

PS, at exactly what version number did format() become available?

On Apr 8, 7:09 am, Daniel Hölbling <hoelblin...@gmail.com> wrote:
> It's already possible using the format function.
> It works like the .NET format function so you can call it with:
>
> format("{0}{1}", "string1", "string2")
> to get a concatenated string "string1string2"
>
> greetings Daniel
>
>
>
> On Thu, Apr 8, 2010 at 9:19 AM, Julian Birch <julian.bi...@gmail.com> wrote:
> > Try using format to achieve this. :)
>

> > On Thursday, April 8, 2010, ADV <denis.aga...@hotmail.com> wrote:
> > > Well, i see no answer today but is their any plans to support string
> > > concatination?
>
> > > Now dotless core doesn't crashes on such syntax:
>
> > > @var: "hello";
>
> > > a
> > > {
> > >     background: url(@var + " World!");
> > > }
>
> > > to:
>
> > > a
> > > {
> > >     background: url("hello World!");
> > > }
>
> > > I just add replacing string "  +  " to string.empty and it's ok now,
> > > it would be great to concat several times in future and i hope you
> > > will support it.
>
> > > --

> > > To unsubscribe, reply using "remove me" as the subject.- Hide quoted text -

James Foster

unread,
Apr 8, 2010, 8:53:51 AM4/8/10
to dot...@googlegroups.com
I agree. & or + should be used as string concatenation as well. It's just slightly trickier to implement.

the format function was introduced on March 28th

http://github.com/jamesfoster/dotless/commit/97171fe1daa9fabc1a0078c0c433f724e2e350d0

I don't think the build server is correctly checking github for changes because it hasn't created any builds since the 25th.

James

Daniel Hölbling

unread,
Apr 8, 2010, 9:15:26 AM4/8/10
to dot...@googlegroups.com
Build server works now.

James Foster

unread,
Apr 8, 2010, 9:19:50 AM4/8/10
to dot...@googlegroups.com
If you download the binaries from dotlesscss.com you should now get the latest version.

James

James Foster

unread,
Apr 8, 2010, 11:51:51 AM4/8/10
to dot...@googlegroups.com
Any thoughts?

StringFormat()
FormatString()

Something else?

James Foster

unread,
Apr 8, 2010, 12:57:22 PM4/8/10
to dot...@googlegroups.com
here's a link that explains the @font-face directive

http://www.devx.com/webdev/Article/43218/1763/page/2
Reply all
Reply to author
Forward
0 new messages