Questions tagged as 'string'

6
answers

How to do a Split for when there is a letter in the string?

I'd like to make a string be split with .Split() every time there is a letter. Example: The string : 97A96D112A109X115T114H122D118Y128 A array would come with 9 values: { 97 96 112 109 115 114 122 118 128 } How...
asked by 01.06.2017 / 00:46
1
answer

Generate list of possible combinations

We have 4 teams: Time 1 | Time 2 | Time 3 | Time 4 I would like to know how to automatically build a list of possible match combinations between these teams. Example: Time 1 x Time 2 | Time 1 x Time 3 | Time 1 x Time 4 | ... I'm...
asked by 02.03.2014 / 06:16
2
answers

How to get a snippet of a string?

I have a string like this: ~/Areas/Teste/Views/home/index.cshtml I only need the word next to ~/Areas/ , in the case Teste (remembering that word may vary in size). How do I?     
asked by 09.10.2014 / 15:56
2
answers

Check if a word is within a phrase

Is there a way to check if a word is within a user-described phrase? Ex: palavra = "criativo"; Sentence written by the user: "Eu sou criativo"     
asked by 16.10.2015 / 15:43
2
answers

String interpolation has a better performance than string.Format?

I use Resharper and a few days ago I started using some C # 6 features. In several parts of the code I use string.Format() and I noticed that the Resharper suggests that these snippets be replaced by string interpolation . The ques...
asked by 19.10.2015 / 14:27
4
answers

How can I make a code with a string work with or?

Apparently I'm having problems with strings : public partial class Form1 : Form { private int _adicionar; private int _retirar; public Form1() { InitializeComponent(); } private void _Random_Click(object send...
asked by 19.05.2016 / 15:38
2
answers

What is the difference between assigning and comparing string variables with function or with assignment and comparison operator?

I came across the following questions: What is the difference between the expressions strcpy (s, t) e s = t ? What is the difference between the expressions if (strcmp (s, t) < 0) e if (s < t)  ? I tried to compile...
asked by 11.08.2015 / 00:44
1
answer

Difference between printf and format

Is there any difference between using printf and format ? Example 01: float nota = 5.3f System.out.printf ("Sua nota: %.2f", nota) Example 02: float nota = 5.3f System.out.format ("Sua nota: %.2f", nota)     
asked by 19.04.2017 / 22:51
2
answers

What is the name of this structure in Python?

In the following code: first_part = 46 last_part = 57 guess = f'{first_part}{last_part}'.encode() print(guess) print(type(guess)) But I did not understand the code snippet: guess = f'{first_part}{last_part}'.encode() I need an explana...
asked by 27.09.2018 / 15:20
1
answer

Why should I use the StringBuilder class instead of the String class?

Why these two classes are different, as it seems to me that they could be a single class. For example, the method Append , it seems to me that it does the same thing as the + operator.     
asked by 03.10.2015 / 03:14