tagged [string]

How should I write a Windows path in a Python string literal?

How should I write a Windows path in a Python string literal? What is the best way to represent a Windows directory, for example `"C:\meshes\as"`? I have been trying to modify a script but it never wo...

13 Jan at 08:24

Convert a string to an enum in C#

Convert a string to an enum in C# What's the best way to convert a string to an enumeration value in C#? I have an HTML select tag containing the values of an enumeration. When the page is posted, I w...

11 Jan at 03:20

Does String.GetHashCode consider the full string or only part of it?

Does String.GetHashCode consider the full string or only part of it? I'm just curious because I guess it will have impact on performance. Does it consider the full string? If yes, it will be slow on l...

30 Dec at 20:40

Replace one character with another in Bash

Replace one character with another in Bash I need to replace a space (``) with a dot (`.`) in a string in bash. I think this would be pretty simple, but I'm new so I can't figure out how to modify a s...

30 Dec at 01:12

Regular Expression to get a string between parentheses in Javascript

Regular Expression to get a string between parentheses in Javascript I am trying to write a regular expression which returns a string which is between parentheses. For example: I want to get the strin...

29 Dec at 01:6

How to remove a defined part of a string?

How to remove a defined part of a string? I have this string: "NT-DOM-NV\MTA" How can I delete the first part: "NT-DOM-NV" To have this as result: "MTA"

28 Dec at 10:1

Convert seconds value to hours minutes seconds?

Convert seconds value to hours minutes seconds? I've been trying to convert a value of seconds (in a BigDecimal variable) to a string in an editText like "1 hour 22 minutes 33 seconds" or something of...

C# - Insert a variable number of spaces into a string? (Formatting an output file)

C# - Insert a variable number of spaces into a string? (Formatting an output file) I'm taking data from a list that I populate a DataGridView with and am exporting it to a text file. I've already done...

Get integer value from malformed query string

Get integer value from malformed query string I'm looking for an way to parse a substring using PHP, and have come across preg_match however I can't seem to work out the rule that I need. I am parsing...

STRING to DATE in BIGQUERY

STRING to DATE in BIGQUERY I am struggling to try to do this with Google BigQuery: I do have a column with dates in the following STRING format: I am wondering how can I deal with this, trying to use ...

21 Dec at 22:52

How can I tell if a VARCHAR variable contains a substring?

How can I tell if a VARCHAR variable contains a substring? I thought it was `CONTAINS`, but that's not working for me. I'm looking to do this: I have to run one `select` or another, depending on wheth...

21 Dec at 04:50

Powershell: convert string to number

Powershell: convert string to number I have an Array where some drive data from WMI are captured: The Array has these values (2 drives): and just want to convert the 1.500 into a number 1500 I tried d...

20 Dec at 00:57

RestTemplate: How to send URL and query parameters together

RestTemplate: How to send URL and query parameters together I am trying to pass path param and query params in a URL but I am getting a weird error. Below is the code. ``` String url = "http://test.co...

Correct way to use StringBuilder in SQL

Correct way to use StringBuilder in SQL I just found some sql query build like this in my project: Does this `StringBuilder` achieve its aim, i.e reducing memory usage? I doubt that, because in the co...

19 Dec at 19:49

How to extend C# built-in types, like String?

How to extend C# built-in types, like String? I need to `Trim` a `String`. But I want to remove all the repeated blank spaces within the String itself, not only at the end or at the start of it. I cou...

18 Dec at 22:59

Java generating Strings with placeholders

Java generating Strings with placeholders I'm looking for something to achieve the following: I could write it myself, but It seems to me that I saw a library once which did this, probably it was the ...

18 Dec at 15:28

How do I get a substring of a string in Python?

How do I get a substring of a string in Python? I want to get a new string from the third character to the end of the string, e.g. `myString[2:end]`. If omitting the second part means 'to the end', an...

16 Dec at 02:7

How to evaluate a math expression given in string form?

How to evaluate a math expression given in string form? I'm trying to write a Java routine to evaluate math expressions from `String` values like: 1. "5+3" 2. "10-4*5" 3. "(1+10)*3" I want to avoid a ...

15 Dec at 23:39

Find the Number of Occurrences of a Substring in a String

Find the Number of Occurrences of a Substring in a String Why is the following algorithm not halting for me? In the code below, `str` is the string I am searching in, and `findStr` is the string occur...

15 Dec at 17:9

Python convert tuple to string

Python convert tuple to string I have a tuple of characters like such: How do I convert it to a string so that it is like:

String replacement in java, similar to a velocity template

String replacement in java, similar to a velocity template Is there any `String` replacement mechanism in Java, where I can pass objects with a text, and it replaces the string as it occurs? For examp...

Strip off specific parameter from URL's querystring

Strip off specific parameter from URL's querystring I have some links in a Powerpoint presentation, and for some reason, when those links get clicked, it adds a return parameter to the URL. Well, that...

How can I securely embed a static string (key) in C#?

How can I securely embed a static string (key) in C#? I'm looking for a way to securely store an API key in a WP7 application. The key is a string and is currently hard coded into the code (see below)...

11 Dec at 13:44

Converting a sentence string to a string array of words in Java

Converting a sentence string to a string array of words in Java I need my Java program to take a string like: and turn it into a string array like: No periods, or punctuation (preferably). By the way,...

10 Dec at 15:18

Converting a String to a List of Words?

Converting a String to a List of Words? I'm trying to convert a string to a list of words using python. I want to take something like the following: Then convert to something like this : Notice the om...

10 Dec at 15:16