Skip to main content
Filter by
Sorted by
Tagged with
4 votes
2 answers
112 views

I am attempting to use a single element of an array, when creating a string message, but it is using both elements, concatenated by a space, whether I use $myArray[0] or $myArray[1]... # Multiple ...
Todd Powers's user avatar
2 votes
1 answer
62 views

I am using Scala 3.3.7. When I do val str1 = raw"\\\" // compile error: unclosed string literal It is considering the \" as a single character. But when I do val str1 = raw"\\\\&...
Mradul Singhal's user avatar
0 votes
1 answer
103 views

I use std::format in my logging, and it largely works great. However, std::format ignores extra arguments which I do not like. E.g., std::format("x = {}", x, y) compiles, so I want a ...
bers's user avatar
  • 6,309
1 vote
2 answers
119 views

Let's say I have a string: $line = "name=""abc""" I want to extract whatever is written within the quotation marks, like this: [regex]::Matches($line,'(?<=name="...
RocketSearcher's user avatar
2 votes
2 answers
180 views

I've just come across such usage of Perl constants: use strict; use warnings; use constant PI => 4 * atan2(1, 1); print("The value of PI is: ${\PI}\n"); # The value of PI is: 3....
Eugene Yarmash's user avatar
1 vote
1 answer
56 views

I am trying to interpolate variables within an Ansible play. I have the following variables: target_hostname user_account account_password user_account_password is in a vault, and the variable is ...
Kevin Huntly's user avatar
0 votes
1 answer
62 views

I am following https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-compute-virtualmachines-metrics to export some metrics from Azure. If build some code that ...
MHU's user avatar
  • 17
0 votes
0 answers
30 views

In the messages file of my multilingual Angular project, I have strings that only contain {$INTERPOLATION} and nothing else. These obviously don't need to be translated. They are mistakes, where there ...
hakuni's user avatar
  • 189
2 votes
1 answer
83 views

I saw this code snippet on the React dev page (https://react.dev/reference/react/memo#updating-a-memoized-component-using-state): export default function MyApp() { const [name, setName] = useState(''...
matronator's user avatar
1 vote
2 answers
71 views

I am writing a Java Spring Boot (servlet) web-API application. There are repository classes in the application. Repository methods are written "from scratch" using Google Cloud Datastore API ...
nickolay's user avatar
  • 3,925
1 vote
1 answer
68 views

I'm trying to use the Scala extensions to extend the String context to time the execution of a costly method And I came with this: extension(sc: StringContext) def timeit(args: Any*): String = { ...
dr jerry's user avatar
  • 10.1k
0 votes
0 answers
70 views

Note: this is not a duplicate of the question here. That one asks about string concatenation, which is different from string interpolation. Consider this example of string creation in C#: var str = $&...
user3163495's user avatar
  • 4,026
-1 votes
1 answer
92 views

When deploying a Windows EC2 instance with Terraform, I want to create a user using the User_Data template. I am also passing a random_password variable to the template. In the main.tf I have: ...
kfkenshin's user avatar
0 votes
1 answer
54 views

I am trying to follow this dart guide https://codelabs.developers.google.com/codelabs/dart-patterns-records#4 but ran into an issue with string interpolation. I am totally puzzled why dart expects a ...
László Frank's user avatar
0 votes
1 answer
49 views

I have a data class Shift: @Serializable data class Shift( @SerialName("id") val id: String, @SerialName("username") val username: String, @SerialName("start")...
ZoutigeWolf's user avatar
1 vote
1 answer
164 views

Is it possible to customize the formatting when using string interpolation with Lean4? More precise: I want to format using hexadecimal digits and add zeros as padding. Minimal example (Same example ...
Random Citizen's user avatar
19 votes
1 answer
2k views

I need braces in a raw string literal that uses interpolation: var bar = "Bar"; var s = $""" Foo {bar} Baz {{Qux}} """; Console.WriteLine(s); I expect ...
lonix's user avatar
  • 22.5k
2 votes
2 answers
114 views

I want to silently ignore KeyErrors and instead replace them with placeholders if values are not found. For example: class Name: def __init__(self, name): self.name = name self....
Pearoo's user avatar
  • 104
0 votes
0 answers
30 views

Consider the following simple example. Two counters are rendering, once with ref that gets updated every second and one static: <script setup> import { onMounted } from 'vue'; import { ref } ...
CMTV's user avatar
  • 3,111
-6 votes
1 answer
187 views

I like being able to do this: print( "\("YYYY") \(454.90008)" ) but I want to do this: print( "\("YYYY") \(String(format: "%.3f", 454.90008))" ) ...
igouy's user avatar
  • 2,700
1 vote
2 answers
189 views

Hoping you can help - this may be a simple question. I've got a list of the unicode values of emojis, and I'm trying to randomly display one. Here is where I'm hardcoding displaying the smiley: ...
mark0417's user avatar
0 votes
1 answer
105 views

When writing a string interpolation with sql"", how can I make sure that a Binder is present for a given parameter type instead of using the default that might not do what I want? For ...
WilQu's user avatar
  • 7,483
0 votes
1 answer
382 views

Having a hard time trying to make this work. I'm trying to use the generate block to add a for_each and run the module multiple times depending on how much entries I have in the variable s3, but ...
Kaleby Cadorin's user avatar
1 vote
1 answer
81 views

I have an array of objects, I would like to combine a string and an array while showing in ngfor iteration. temp: [ { "value1": "as", "value2": "[a, b, c, ...
Naeem Akhtar's user avatar
  • 1,635
5 votes
3 answers
241 views

Original Question My boyfriend is celebrating his birthday shortly and I am ordering a custom cake for him. I want to write Happy Birthday on it in a clever Ruby coding way. It will be on a black ...
programmersgirlfriend's user avatar
0 votes
1 answer
661 views

In the ServiceFile I have this signal: answerSequence = signal<string[]>(['', '', '', '']); I get this angular signal to my Component: answerSequence = computed(() => this.questionService....
Joe's user avatar
  • 13
0 votes
0 answers
33 views

I am trying to print a line from a file with interpolation. I have the following code: open FH, "<", "file.txt"; my $line = <FH>; print "line = " . $line . "...
Robert Key's user avatar
2 votes
2 answers
125 views

I have code in a package (class) that has a sorting function with a prototype: #!perl package Foo; use strict; use warnings; sub new { my ($class, $value) = @_; my $self = bless{}, $class; ...
Robert's user avatar
  • 9,056
1 vote
1 answer
290 views

I am sure this is not a unique requirement and I have delt with this type of issue using eval() syntax in few other programming and scripting environments. My problem: I am trying to create a ...
ankur kapoor's user avatar
0 votes
3 answers
103 views

I want to display details of a student, but the values are not showing up on the app. the component: import { Component, OnInit } from '@angular/core'; import { Student } from '../student'; import { ...
Yahya Bekaoui's user avatar
-1 votes
1 answer
822 views

Java finally supports string interpolation! I'm very happy about it. However, the syntax seems to me a bit clumsy // string templating syntax from Java 23 String greeting = STR."Hello \{name}!&...
Powet's user avatar
  • 307
0 votes
1 answer
82 views

I was reading the Jenkins documentation and saw the following example: pipeline { agent any environment { EXAMPLE_CREDS = credentials('example-credentials-id') } stages { ...
Matheus's user avatar
  • 351
1 vote
1 answer
36 views

I am trying to create a subclass of HashMap with its own string representation. I figured that I just needed to override toString() in the subclass: class Foo extends HashMap { String toString() { ...
Xophmeister's user avatar
  • 9,249
2 votes
1 answer
84 views

I have an object with some optional attributes which I want to list in a string template (In a sort of JSON way) If the attribute is None I don't want to see anything, if it is Non None I want to see ...
dr jerry's user avatar
  • 10.1k
0 votes
1 answer
51 views

I am passing in the following as a query (.dbtable) to pyspark, running in jupyter notebook on AWS EMR. num = [1234,5678] newquery = "(SELECT * FROM db.table WHERE col = 1234) as new_table" ...
andruidthedude's user avatar
1 vote
2 answers
363 views

I have an Angular component that I depend on. This component has a getData method, then this method is called in the template of this component, and the result is displayed using Angular interpolation....
Andrii Hnatushchenko's user avatar
0 votes
1 answer
134 views

I am building a yaml string within Jenkins scripted pipeline that is parametrized. The problem is that I get error interpolating string with a variable that is a list of maps. I don't think I can use ...
Dmitry Tokarev's user avatar
0 votes
0 answers
44 views

I'm working on a simple (but hopefully type-safe) system that represents timeSlots as strings. // example const t1 = "|mon::10:30|"; const t2 = "|fri::20:00|"; So far I have ...
Felipe Chernicharo's user avatar
0 votes
0 answers
27 views

I am using a release pipeline to get a valid token, the client secret, and the user password via Azure Key Vault I am getting the client secret, and the user password. I did some tests and saw that ...
Bandit's user avatar
  • 523
1 vote
1 answer
2k views

Delphi 12 introduced multiline strings and I'm trying to figure out how it works, coming from a JavaScript background. There I can directly have variables in multiline strings such as: const myName = '...
Martin Kakhuis's user avatar
0 votes
1 answer
336 views

I'm trying to create a reusable component for presenting a Swift collections OrderedSet into a SwiftUI List with delete, move and add handlers. I would like to be able to pass in an OrderedSet of any ...
thiezn's user avatar
  • 2,034
0 votes
3 answers
175 views

(a) the codes I wrote. $str = '909090 aa bb cc dd ee ff 00 12345678 aa bb 12345678 aa bb cc dd ee ff 00 11 22 33 123456 FE 89' puts $str $str.gsub!(/\s+/, '') search_1 = 'aa bb cc dd ee ff 00 (\S{8} ...
Bridge IC's user avatar
-1 votes
1 answer
1k views

I have a shell command in my Jenkins script that uses string interpolation for non secret values as well as secret values. For non secret values, you are expected to use double quotes and the string ...
Mo0rBy's user avatar
  • 759
0 votes
1 answer
308 views

i'm trying to execute with powershell follow query: $upn = "[email protected]" $URL = "https://graph.microsoft.com/v1.0/users?$filter=mail eq '$upn'" #Send Request Invoke-...
Emanuele's user avatar
  • 353
0 votes
2 answers
122 views

I have a few similarly named arrays and I need to loop through the array names: level_1_foo level_2_foo level_3_foo level_4_foo level_5_foo I'd like to do something like the following where x is the ...
John Cowan's user avatar
  • 1,764
-1 votes
2 answers
65 views

Is there a way to store a string interpolation template into a variable in JavaScript and just call it as a function (or something like this)? I would like to do something like this: const myStr = `...
Raniere Soares's user avatar
0 votes
1 answer
341 views

I need this: If the following formatted value is null, display N/A. Otherwise, display the formatted value. It needs to be with string interpolation. I tried to do something like nested interpolation: ...
ISquared's user avatar
  • 472
10 votes
2 answers
11k views

Every example I have seen of Python string variable interpolation uses the print function. For example: num = 6 # str.format method print("number is {}".format(num)) # % placeholders print(...
skeetastax's user avatar
  • 1,816
0 votes
0 answers
314 views

Short Version after reading the httpclient logs, I'm seeing that some characters are being url-encoded. I dont want that to happen. Long Version the url I'm calling is split into <base url>+<...
Jonathan-Zollinger's user avatar
1 vote
0 answers
39 views

Below is an extract from my script. The script checks if users are part of a specific AD groud then saves the users and the group they're a member of to a .CSV file. function Process-UsersInOU { ...
Nuisance's user avatar

1
2 3 4 5
23