Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

Please explain each aspect of the string concatenation

clientsideVisibilityHider.AppendLine($@"$(""#{clientIds[i]}"").addClass(""d-inline-block"");");


Please explain each character and what is it doing...


This is C#.


$@"$(""#{clientIds[i]}"").addClass(""d-inline-block"");"

ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can you perhaps use

clientsideVisibilityHider.AppendLine($@"
    $(`#{clientIds[i]}`)
        .addClass('d-inline-block');
");

Open in new window


I am a little worried about the clientIds[ i ], it looks as if you have several

clientsideVisibilityHider.AppendLine()
clientsideVisibilityHider.AppendLine()
clientsideVisibilityHider.AppendLine()

Open in new window


in a non-intuitive and hard to read manner
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

Can they be used in either sequence, to the same effect?

$@
@$

?

Yes. It is simply the two concepts $ and @ combined together, so it doesn't make a difference which order they are in.