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?