Tag: string

55 votes
25 answers
2.4K views
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: "5+3" "10-40" "(

avatar
Stacia
0 1 0 9
asked 07 September, 2021
54 votes
6 answers
2.5K views
How to find the length of a string in R

How to find the length of a string (number of characters in a string) without splitting it in R? I know how to

avatar
Nereida
0 1 0 9
asked 07 September, 2021
54 votes
12 answers
1.9K views
How can two strings be concatenated?

How can I concatenate (merge, combine) two values? For example I have: tmp = cbind("GAD", "AB") tmp # [,

avatar
Alphonso
0 1 0 9
asked 07 September, 2021
63 votes
6 answers
444 views
How to concat string + i?

for i=1:N f(i) = 'f'+i; end gives an error in MatLab. What's the correct syntax to initial

avatar
Jeff
0 1 0 9
asked 07 September, 2021
52 votes
8 answers
1.3K views
How to search for a string in cell array in MATLAB?

Let's say I have the cell array strs = {'HA' 'KU' 'LA' 'MA' &ap

avatar
Winford
0 1 0 9
asked 07 September, 2021
54 votes
22 answers
3K views
Extract substring in Bash

Given a filename in the form someletters_12345_moreleters.ext, I want to extract the 5 digits and put them int

avatar
Wilber
0 1 0 9
asked 07 September, 2021
58 votes
21 answers
906 views
How to convert a string to lower case in Bash?

Is there a way in bash to convert a string into a lower case string? For example, if I have: a="Hi all" I

avatar
Tuan
0 1 0 9
asked 07 September, 2021
51 votes
26 answers
2K views
How to check if a string contains a substring in Bash

I have a string in Bash: string="My string" How can I test if it contains another string? if [ $string ?? &ap

avatar
Sena
0 1 0 9
asked 07 September, 2021
51 votes
30 answers
1.5K views
How to concatenate string variables in Bash

In PHP, strings are concatenated together as follows: $foo = "Hello"; $foo .= " World"; Here, $foo becomes

avatar
Luis
0 1 0 9
asked 07 September, 2021
63 votes
17 answers
3K views
Using LINQ to concatenate strings

What is the most efficient way to write the old-school: StringBuilder sb = new StringBuilder(); if (strings.C

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
69 votes
13 answers
3.2K views
How to read values from the querystring with ASP.NET Core?

I'm building one RESTful API using ASP.NET Core MVC and I want to use querystring parameters to specify f

avatar
Benton
0 1 0 9
asked 07 September, 2021
48 votes
7 answers
2.3K views
Convert UTF-8 encoded NSData to NSString

I have UTF-8 encoded NSData from windows server and I want to convert it to NSString for iPhone. Since data co

avatar
Royal
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
1K views
How do I test if a string is empty in Objective-C?

How do I test if an NSString is empty in Objective-C?

avatar
Deedee
0 1 0 9
asked 07 September, 2021
57 votes
14 answers
491 views
How do I convert an NSString value to NSData?

How do I convert an NSString value to NSData?

avatar
Winford
0 1 0 9
asked 07 September, 2021
61 votes
14 answers
1.3K views
Constants in Objective-C

I'm developing a Cocoa application, and I'm using constant NSStrings as ways to store key names for

avatar
Wilfredo
0 1 0 9
asked 07 September, 2021
63 votes
23 answers
2.2K views
How do I check if a string contains another string in Objective-C?

How can I check if a string (NSString) contains another smaller string? I was hoping for something like: NSS

avatar
Thurman
0 1 0 9
asked 07 September, 2021
61 votes
21 answers
2.2K views
Multiline strings in VB.NET

Is there a way to have multiline strings in VB.NET like Python a = """ multi line string """ or PHP? $a =

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
54 votes
12 answers
1.4K views
Is String.Format as efficient as StringBuilder

Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new StringBuilder(); string cat = "ca

avatar
Shanita
0 1 0 9
asked 07 September, 2021
59 votes
12 answers
1.9K views
How do you get a string from a MemoryStream?

If I am given a MemoryStream that I know has been populated with a String, how do I get a String back out?

avatar
Margo
0 1 0 9
asked 07 September, 2021
62 votes
17 answers
2.7K views
Converting string to byte array in C#

I'm converting something from VB into C#. Having a problem with the syntax of this statement: if ((searc

avatar
Freida
0 1 0 9
asked 07 September, 2021