string

  1. D

    Split string with a text qualifier

    Hello All. This is my first post, I'm new to C#. I would like to spilt the below string. My delimiter => ";" and each part is in double quotes. string myLine = "John Smith"; "A"; "45", "Nearly done; follow up"; My expected output: John Smith A 45 Nearly done; follow up I tried to go with...
  2. ICauseDarkDays

    Resolved Help - How to check if a string is filled?

    I am creating a Text-Based game, and when I first started, I just made it so that if you skipped past the naming process, you would be given a name, but I don't want players to skip past the process anymore. I want them to pick their names out intentionally, but I don't know how to make it so...
  3. 2

    Resolved Does documentation claim you can split Strings on Strings?

    I don't understand what I am reading wrong... According to this section of the documentation, Strings should be able to be split using a second String as the seperator. The documentation says: However, when I actually attempt this, the code fails and throws an error, claiming that the...
  4. G

    Question string variable broken

    So, I'm using this bit of code in "Visual Studio Code" and it keeps saying: "Converting null literal or possible null value to non-nullable type." string name = Console.ReadLine(); This is the bit of code I am using and it should work fine! Please help me!
  5. E

    Question How to write non-ascii characters on maskedTextBox?

    I'm using TripleDESCryptoService and I keep the encrypted text in byte[]. I want to display this on a textBox. So I choose AsciiOnly = False for maskedTextBox. Now I copy a non-ascii character and paste it on maskedTextBox and there is no problem. But when I do it in code it fails. Example text...
  6. Socarsky

    Convert a List<object> to a string[,] 2D array

    I am in a difficulty to convert a List that is class object which populated from database, so far so good to have that list of object but I need its string[,] (2D) array as converted to apply a method which helps to get an print output. private void dateTimePicker1_ValueChanged(object sender...
  7. Sajo

    Resolved Problem with verbatim string

    Hello everybody! I have a problem with verbatim string. I want to write this "c:\\projects\\project1\\enter" I use verbatim string for that. But when I run console it always display me c:\projects\project1\enter. I want to write code which is easier to read. I want double backslash not just one...
  8. M

    Resolved Value types and reference types

    Hi everyone, First question here... If I'm correct, String is a reference datatype, right? See my code below: String nameOne = "Matthew"; String nameTwo = nameOne; nameOne = "Andrew"; In the end, I should expect both nameOne and nameTwo to be Andrew...
  9. S

    Question Why My List<string> Saved In User Settings doesn´t Save the strings?

    Good Day, I Have A List<string> Saved In My App User Settings, this List is supposed to save the file paths of a openfiledialog to then deserialize it, but I already Called the method Save(); And even the method Upgrade(); After adding the strings to the list, but this strings, doesn´t save. Why?
  10. G

    Question Improving speed in my code

    Is there any way to improve the speed in my script?? Thanks in advance, appreciate any help. using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace MegaTool { public static class mega...
  11. S

    Question Unhandled exception string problem user input

    Hello all: I'm new to coding and this forum, using c# visual studio 2012. I am trying to get this code to read the user input and read it on a separate line. I get an un-handled exception, not sure why. Thank You using System; using System.Collections.Generic; using System.Linq; using...
  12. M

    Question Search for strings by its partial name?

    So i'm doing some practice exercises and i came across the issue. Lets say we have entered a string : "My name is Tod", "My life is hard", "Do you even lift bruh?". so what i'm asking is what kind of code should it be so that if i type "Tod" in my "search" it would find that string?
  13. A

    Question How can I access webpage text data and store it within a text block in my .WPF?

    Hello, I am very new to C# and coding in general. I wanted to connect to a commonly used website/webpage: IMDB, Avengers 2 and essentially take some text from that page, store it within a string, and then print that out within a text block. So I gave it a go, you'll probably cringe but oh...
  14. RedTurbo

    Question How to control what the user enters and give an error if needed?

    Hello, I am making a C# console application which calculates BTEC grades to UCAS points. Only thing is, this course has 18 units, so I want the user to enter either 'p', 'm' or 'd' and maybe some other inputs if I choose to later. So when the user enters something wrong like 'wefttryh239y' then...
Back
Top Bottom