1,146 questions
3
votes
1
answer
453
views
Convert all strings in a class to interpolated strings [closed]
I want to convert all strings that have a variable in it, example:
string = "Hi " + name + ", How are you?"
to his interpolated version, refactoring all these cases in a class.
I ...
0
votes
0
answers
60
views
Convert pattern string to Interpolated string with dollar sign
var pattern = getPattern(); //read from the config, something like "{x} abc {y}"
var x = $pattern; //not compiling
Is there a way to convert a pattern in string Interpolated string?
0
votes
2
answers
236
views
prevent running function on backtick angular
i have this syntax on angular(typescript), my problem is when this code runs, its automatically runs clickShowAttachments function, instead i am need to run function when this button clicks ...
${data....
0
votes
0
answers
172
views
How do I update a variable within string interpolation in JavaScript?
I have a global variable data_year in a file called energy-maps.globals.v0.js
/**
* @type {number}
* @description The year value to determine data loaded by the application.
*/
var data_year = 2012;...
2
votes
2
answers
161
views
interpolate string from index ranges
I have an array of index ranges and a string:
const ranges = [[2,5], [11, 14]]
const str = 'brave new world'
I'm trying to write a function to interpolate and wrap the characters at those ranges.
...
1
vote
2
answers
47
views
Write a string followed by array items as a list
I have an array of objects, I want to be able to join it a string followed by having some of those array objects as part of a newly formed ordered list.
My code:
let arr = [
{
...
3
votes
1
answer
429
views
c#: interpolated string to printout variable name and value
Is there a shorter way to print out a variable name and its value in C#? What i do now is:
int myvar = 42;
Console.WritelLine($"{nameof(myvar)}={myvar}"); // or any other log function
//...
2
votes
1
answer
878
views
How to do string interpolation in template element in Vue.js?
I am iterating through a dictionary (called in from a .json file) and would like to check an attribute of my props with a value in the dictionary. In my first div I am setting the variable attribute ...
3
votes
2
answers
2k
views
Is there a way to use string interpolation with an SF Symbol that has a modifier on it?
I want to use string interpolation on an SF Symbol that has a rotationEffect(_:anchor:) modifier applied to it. Is it possible to do this?
Without the modifier this type of string interpolation works ...
0
votes
0
answers
31
views
String interpolation in PowerShell for hashmaps [duplicate]
I have a list of hashmaps. I want to create comma separated string for each item. If I use the following, it works fine.
$users | ForEach-Object {$_.firstname + "," + $_.surname}
But when I ...
5
votes
1
answer
130
views
Why aren't variables interpolated in `constant` declarations?
use v6.d;
my Str $foo = 'Hello';
my constant $BAR = "--$foo--";
say $BAR;
OUTPUT:
Use of uninitialized value element of type Str in string context.
Methods .^name, .raku, .gist, or .say ...
1
vote
2
answers
274
views
Scala case class string pattern matching not working as expected?
I am using scala 2.13 and have a string like this:
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAtp/Uo28kOjROL50aajnpK25CJoVoic2bqqu6OS2baWWD9fT2
ESqq8mbFxYN3O7JXbs+74YpTdg1jSUALOz9zj/...
1
vote
1
answer
1k
views
Creating PowerShell File Using New-Item & Add-Content Cmdlets [duplicate]
This is the first time posting on SO (and really on any public platform), so I apologize if this question was already answered or if the question isn't structured appropriately.
I am brand new to ...
1
vote
2
answers
763
views
Vue 3 - Composition API - Dynamically add template with text interpolation
I have a Component that take a string property, like this:
<script lang="ts" setup>
const props = defineProps<{
transcription?: string;
}>();
watch(() =...
0
votes
2
answers
197
views
Covert terraform custom variable to some specific format issue
The below is the custom variable that will use for specific AWS resource creation
INPUT Variable:
VAR = {
"commonPolicy" = [
"DenyRootUser",
"...
6
votes
1
answer
1k
views
Why does the behaviour of LocalizedStringKey depend on whether I pass a string interpolation to its initialiser?
While trying to answer this question, I found a strange behaviour.
Text(LocalizedStringKey("Hello \(Image(systemName: "globe"))"))
displays a globe, but
Text(LocalizedStringKey(&...
0
votes
1
answer
1k
views
What method is called during Ilogger conversion of structured logging arguments to string?
I have an object that I want to pass to logging (default built-in logging to console, no libraries used) as argument like this:
logger.LogDebug("Executing MongoDB command: {Command}", ...
-1
votes
1
answer
350
views
JavaScript interpolation and template literals not allowing me to push to array
I have a need for referencing an array name out of other variables values. Below is a simple program that doesn't push the value into an array. I was hoping someone could determine why. There is no ...
0
votes
1
answer
705
views
When does the C# compiler concatenate interpolated strings?
We know that C# optimizes the concatenation of string literals. For those unaware, that's when C# internally turns this:
string myString = "one" + "two" + "three";
into ...
0
votes
0
answers
303
views
How to use image scan ecr command in a loop in a Jenkins pipeline
I wanted to create a jenkins pipeline that scans all the docker images in ecr..I have used the list-images command to list all the images and extracted ImageDigests in a ArrayList(arr).
But it wouldn'...
1
vote
0
answers
21
views
How do I properly pass multiple arguments to an executable from a single string? [duplicate]
I have roughly the following script:
# Those are actually passed as cmdlet parameters into the script
$FFmpegPath = "ffmpeg"
$Args = "-i MyInput.mp4 MyOutput.webm"
& $...
0
votes
1
answer
303
views
How to dynamically create a string in an html tag
I need to create a table dynamically, this table has three accordion levels (unfolding line) so I need to assign an id to each of my <tr> tags for bootstrap's accordion functionality to work ...
1
vote
1
answer
889
views
Angular - Using interpolation with ternary operator in Input property binding
I am trying to make this property binding to work. I want to use ternary operator where conditions are interpolated strings. HTML is compiling, but the element is not showing.
<si-icon [icon]="...
0
votes
0
answers
67
views
php variable interpolation inside variable [duplicate]
I have a challenge that I have a hard time describing it in a short web search. I'm hoping if I can successfully explain it long form all the experts here can understand what I'm asking and let me ...
0
votes
1
answer
47
views
How might I output formatted text to the screen without having to write each time the relevant escape sequences?
I am aware that I can display formatted text in Racket with display like so:
(display "\33[3mSth in italic\33[m without any macro.\n")
Much like I would do it in Bash:
ita='\e[3m'
end='\e[0m'...