tagged [string]

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...

Which of one from string interpolation and string.format is better in performance?

Which of one from string interpolation and string.format is better in performance? Consider this code: Which of one from string interpolation and `string.Format` is better in performance? Also what ar...

Regular Expression Match to test for a valid year

Regular Expression Match to test for a valid year Given a value I want to validate it to check if it is a valid year. My criteria is simple where the value should be an integer with `4` characters. I ...

Join list of string to comma separated and enclosed in single quotes

Join list of string to comma separated and enclosed in single quotes now the s is `'test's','test','test's more'` but I need to replace the inner quotes with 2 single quotes like this: `'test''s','tes...

4 Aug at 00:3

Can maximum number of characters be defined in C# format strings like in C printf?

Can maximum number of characters be defined in C# format strings like in C printf? Didn't find how to do that. What I found was more or less on the lines of this ([http://blog.stevex.net/string-format...

2 Mar at 00:28

Using Python String Formatting with Lists

Using Python String Formatting with Lists I construct a string `s` in Python 2.6.5 which will have a varying number of `%s` tokens, which match the number of entries in list `x`. I need to write out a...

Smart string comparison

Smart string comparison I am looking for a library/class that allows smart compare of two strings. At best it would give as a result percent of how two strings are alike. I am comparing company names,...

23 May at 11:56

Is it better practice to use String.format over string Concatenation in Java?

Is it better practice to use String.format over string Concatenation in Java? Is there a perceptible difference between using `String.format` and String concatenation in Java? I tend to use `String.fo...

Format a Go string without printing?

Format a Go string without printing? Is there a simple way to format a string in Go without printing the string? I can do: But I want the formatted string returned rather than printed so I can manipul...

How to compare Unicode characters that "look alike"?

How to compare Unicode characters that "look alike"? I fall into a surprising issue. I loaded a text file in my application and I have some logic which compares the value having µ. And I realized that...

String.Equals vs String.Compare vs "==" in Action. Explanation needed

String.Equals vs String.Compare vs "==" in Action. Explanation needed Following is the code snippet from a console application - ``` class MyClass { public int GetDay(string data22) { int r...

6 Mar at 21:42

How to find the length of a string in R

How to find the length of a string in R How to find the length of a string (i.e., number of characters in a string) without splitting it in R? I know how to find the length of a list but not of a stri...

5 Jan at 21:26

In C#, what is the best way to compare strings with null and "" return true

In C#, what is the best way to compare strings with null and "" return true I have the following code (as i am trying to detect changes to a field) the issue is I am having cases where person.State is...

16 Aug at 21:21

Using an array as argument for string.Format()

Using an array as argument for string.Format() When trying to use an array as an argument for the `string.Format()` method, I get the following error: > FormatException: Index (zero based) must be gre...

Removing numbers from string

Removing numbers from string How can I remove digits from a string?

10 Oct at 04:16

How to get a null terminated string from a C# string?

How to get a null terminated string from a C# string? - -

6 Jul at 19:35

Caselessly comparing strings in C#

Caselessly comparing strings in C# Let's say I have two strings: a and b. To compare whether a and be have the same values when case is ignored, I've always used: However, using Reflector, I've seen t...

14 Apr at 14:43

Clear array of strings

Clear array of strings What is the easiest way to clear an array of strings?

26 Sep at 12:43

How to convert a String to CharSequence?

How to convert a String to CharSequence? How to convert `String` to `CharSequence` in Java?

29 Jun at 13:12

Capitalize words in string

Capitalize words in string What is the best approach to capitalize words in a string?

30 Oct at 10:42

Using == or Equals for string comparison

Using == or Equals for string comparison In some languages (e.g. C++) you can't use operators like == for string comparisons as that would compare the address of the string object, and not the string ...

28 Dec at 10:10

How to convert String object to Boolean Object?

How to convert String object to Boolean Object? How to convert `String` object to `Boolean` object?

26 Sep at 05:46

How to change string into QString?

How to change string into QString? What is the most basic way to do it?

27 Jan at 23:55

Remove final character from string

Remove final character from string How do I remove the last character from a string?

25 Apr at 00:0

Most efficient way to concatenate strings?

Most efficient way to concatenate strings? What's the most efficient way to concatenate strings?

Python string class like StringBuilder in C#?

Python string class like StringBuilder in C#? Is there some string class in Python like `StringBuilder` in C#?

3 Jun at 10:5

Curly braces in string in PHP

Curly braces in string in PHP What is the meaning of `{ }` (curly braces) in string literals in PHP?

17 Oct at 12:48

Convert int to string?

Convert int to string? How can I convert an `int` datatype into a `string` datatype in C#?

9 Jun at 04:33

How can I exclude one word with grep?

How can I exclude one word with grep? I need something like:

9 Apr at 21:12

How to convert list to string

How to convert list to string How can I convert a list to a string using Python?

14 Sep at 19:41

Get first 250 words of a string?

Get first 250 words of a string? How do I get the first 250 words of a string?

13 Nov at 20:38

How should I concatenate strings?

How should I concatenate strings? Are there differences between these examples? Which should I use in which case? ``` var str1 = "abc" + dynamicString + dynamicString2; var str2 = String.Format("abc{0...

23 May at 12:32

Replace Line Breaks in a String C#

Replace Line Breaks in a String C# How can I replace Line Breaks within a string in C#?

26 Oct at 13:20

Trim string in JavaScript

Trim string in JavaScript How do I remove all whitespace from the start and end of the string?

13 Jun at 01:47

Does VBScript have a substring() function?

Does VBScript have a substring() function? Is there a `substring()` function in VBScript similar to Java's `string.substring()`?

8 Feb at 17:1

Why does the string type have a .ToString() method?

Why does the string type have a .ToString() method? Why does the string data type have a `.ToString()` method?

28 Nov at 14:24

String, StringBuffer, and StringBuilder

String, StringBuffer, and StringBuilder Please tell me a real time situation to compare `String`, `StringBuffer`, and `StringBuilder`?

27 Aug at 17:3

How to get ° character in a string in python?

How to get ° character in a string in python? How can I get a `°` (degree) character into a string?

7 Jun at 12:35

Remove characters from a string

Remove characters from a string What are the different ways I can remove characters from a string in JavaScript?

21 Oct at 18:1

Java Equivalent to .NET's String.Format

Java Equivalent to .NET's String.Format Is there an equivalent to .NET's `String.Format` in Java?

16 Jun at 23:36

Extract substring from a string

Extract substring from a string what is the best way to extract a substring from a string in android?

15 Jan at 19:39

Why does String.Format convert a forward slash into a minus sign?

Why does String.Format convert a forward slash into a minus sign? Why does `String.Format("/")` get converted to "-"?

16 Aug at 13:55

How to sort a list of strings?

How to sort a list of strings? What is the best way of creating an alphabetically sorted list in Python?

25 Apr at 19:27

Passing base64 encoded strings in URL

Passing base64 encoded strings in URL Is it safe to pass raw base64 encoded strings via GET parameters?

3 Sep at 17:37

C++ Remove new line from multiline string

C++ Remove new line from multiline string Whats the most efficient way of removing a 'newline' from a std::string?

28 Sep at 19:0

Concat strings in a shell script

Concat strings in a shell script How can I concat strings in shell? Is it just... ?

24 Jul at 17:21

Escaping arguments for string.Format in a C# multiline verbatim string

Escaping arguments for string.Format in a C# multiline verbatim string When I format it as a usual string with string.Format, naturally i get an exception that the input string was not in correct form...

8 Oct at 19:31

How to use verbatim strings with interpolation?

How to use verbatim strings with interpolation? In C# 6 there is a new feature: interpolated strings. These let you put expressions directly into code. Rather than relying on indexes: the above become...

How do I turn a String into a InputStreamReader in java?

How do I turn a String into a InputStreamReader in java? How can I transform a `String` value into an `InputStreamReader`?

13 Dec at 23:29

tabbing in C# resource file

tabbing in C# resource file How do i add a TAB (\t) to a string resource ? "\tText" doesn't work

25 May at 15:43