tagged [string]

split string on a number of different characters

split string on a number of different characters I'd like to split a string using one or more separator characters. E.g. "a b.c", split on " " and "." would give the list ["a", "b", "c"]. At the momen...

17 Dec at 02:13

C# Named parameters to a string that replace to the parameter values

C# Named parameters to a string that replace to the parameter values I want in a good performance way (I hope) replace a named parameter in my string to a named parameter from code, example, my string...

Best way to break long strings in C# source code

Best way to break long strings in C# source code I am wondering what is the "best practice" to break long strings in C# source code. Is this string concatenated during compiling or in run time?

5 Jan at 20:8

C# String comparisons: Difference between CurrentCultureIgnoreCase and InvariantCultureIgnoreCase

C# String comparisons: Difference between CurrentCultureIgnoreCase and InvariantCultureIgnoreCase When doing a string comparison in C#, what is the difference between doing a and ..

6 Jan at 20:19

Delete certain lines in a txt file via a batch file

Delete certain lines in a txt file via a batch file I have a generated txt file. This file has certain lines that are superfluous, and need to be removed. Each line that requires removal has one of tw...

7 Jan at 02:12

Looking for a tool to quickly test C# format strings

Looking for a tool to quickly test C# format strings I am constantly forgetting what the special little codes are for formatting .NET strings. Either through ToString() or using String.Format(). Align...

9 Jan at 00:39

Detecting if a string is all CAPS

Detecting if a string is all CAPS In C# is there a way to detect if a string is all caps? Most of the strings will be short(ie under 100 characters)

16 Jan at 21:41

Can I be sure the built-in hash for a given string is always the same?

Can I be sure the built-in hash for a given string is always the same? I am getting a string hash like this: I am then storing the hash into a dictionary as key mapping to another ID. This is useful s...

22 Jan at 13:28

Adding a parameter to the URL with JavaScript

Adding a parameter to the URL with JavaScript In a web application that makes use of AJAX calls, I need to submit a request but add a parameter to the end of the URL, for example: Original URL: > [htt...

Can I "multiply" a string (in C#)?

Can I "multiply" a string (in C#)? Suppose I have a string, for example, I want to basically write it multiple times, depending on some integer value. EDIT: I know I can easily write my own function t...

10 Feb at 16:32

Calling a function from a string in C#

Calling a function from a string in C# I know in php you are able to make a call like: Is this possible in .Net?

12 Feb at 04:49

Need a custom currency format to use with String.Format

Need a custom currency format to use with String.Format I'm trying to use String.Format("{0:c}", somevalue) in C# but am having a hard time figuring out how to configure the output to meet my needs. H...

12 Feb at 18:40

C#: Strings with same contents

C#: Strings with same contents I have heard and read that a string can not be changed (immutable?). That should be correct I guess. But I have also heard that two strings with the same contents share ...

17 Feb at 08:7

How do I parse a token from a string in C?

How do I parse a token from a string in C? How do i parse tokens from an input string. For example: I want the output to be: > "Hello" "world"

17 Feb at 19:32

Does any one know of a faster method to do String.Split()?

Does any one know of a faster method to do String.Split()? I am reading each line of a CSV file and need to get the individual values in each column. So right now I am just using: where `line` is the ...

20 Feb at 10:0

How can I convert a string to upper- or lower-case with XSLT?

How can I convert a string to upper- or lower-case with XSLT? How do you do case conversion in XSL?

26 Feb at 09:22

What is the performance cost of assigning a single string value using +'s

What is the performance cost of assigning a single string value using +'s I have often wondered this, is there a performance cost of splitting a string over multiple lines to increase readability when...

How to add extra newline with 'puts' without sticking newline character into string?

How to add extra newline with 'puts' without sticking newline character into string? If I say and decide to add an extra newline I need to do this: Having this character in the string is ugly. Is ther...

12 Mar at 18:6

Trim a string in C

Trim a string in C Briefly: I'm after the equivalent of .NET's `String.Trim` in C using the win32 and standard C api (compiling with MSVC2008 so I have access to all the C++ stuff if needed, but I am ...

18 Mar at 00:26

How can I add " character to a multi line string declaration in C#?

How can I add " character to a multi line string declaration in C#? If I write something like this: it doesn't work. --- If I try this: it doesn't work either. How can I add a " character to a multi l...

23 Mar at 21:13

Which one is a more reliable matching scheme, EREGI or STRIPOS?

Which one is a more reliable matching scheme, EREGI or STRIPOS? Which scheme according to you is a better one in case of matching? Is it eregi or stripos or any other method?

24 Mar at 12:38

Good Python modules for fuzzy string comparison?

Good Python modules for fuzzy string comparison? I'm looking for a Python module that can do simple fuzzy string comparisons. Specifically, I'd like a percentage of how similar the strings are. I know...

StringBuilder.Append Vs StringBuilder.AppendFormat

StringBuilder.Append Vs StringBuilder.AppendFormat I was wondering about StringBuilder and I've got a question that I was hoping the community would be able to explain. Let's just forget about code re...

2 Apr at 17:3

Base64 String throwing invalid character error

Base64 String throwing invalid character error I keep getting a Base64 invalid character error even though I shouldn't. The program takes an XML file and exports it to a document. If the user wants, i...

Is string.Length in C# (.NET) instant variable?

Is string.Length in C# (.NET) instant variable? I'm wondering if `string.Length` in C# is an instant variable. By instant variable I mean, when I create the string: Is length being computed now? OR Is...

4 Apr at 21:9