How to concatenate strings in twig

Anyone knows how to concatenate strings in twig? I want to do something like: {{ concat(‘http://’, app.request.host) }} 1Best Answer 11 This should work fine: {{ ‘http://’ ~ app.request.host }} To add a filter – like ‘trans’ – in the same tag use {{ (‘http://’ ~ app.request.host) | trans }} As Adam Elsodaney points out, … Read more

Shortcuts in Objective-C to concatenate NSStrings

Are there any shortcuts to (stringByAppendingString:) string concatenation in Objective-C, or shortcuts for working with NSString in general? For example, I’d like to make: NSString *myString = @”This”; NSString *test = [myString stringByAppendingString:@” is just a test”]; something more like: string myString = “This”; string test = myString + ” is just a test”; 30 … Read more

How to concatenate string variables in Bash

In PHP, strings are concatenated together as follows: $foo = “Hello”; $foo .= ” World”; Here, $foo becomes “Hello World”. How is this accomplished in Bash? 30 30 foo=”Hello” foo=”${foo} World” echo “${foo}” > Hello World In general to concatenate two variables you can just write them one after another: a=”Hello” b=’World’ c=”${a} ${b}” echo … Read more