C#11 - Raw String Literals

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 4

  • @steffi2128
    @steffi2128 2 ปีที่แล้ว +2

    Can't you get the same results with the '@' + '$' sign?
    Pretty sure i have done this multiple times already

    • @CuriousDrive
      @CuriousDrive  2 ปีที่แล้ว

      Yeah you can do it. But how easy is it to read the code and understand what it is. Readability is the issue here. Please check this article here - devblogs.microsoft.com/dotnet/csharp-11-preview-updates/#raw-string-literals

  • @PIDOtomasyon
    @PIDOtomasyon 2 ปีที่แล้ว +1

    firstly thank you for your works.
    I need to your help hand.
    I have mettler toledo scaler. I am reading weight datas from serial port as;
    "S S 155.02xxxx" xxxx= I can select TAB or LR,
    if select sender type TAB; "S S 155.02TAB" else "S S 155.02enter" its mean is = 155.02gr...
    Now, I want to append to textBox only "155.02" and if incoming data is = "000.00" not allow to add to textBox.
    The scaler sending data done after stabil.
    Thank you. Urgent please.

    • @CuriousDrive
      @CuriousDrive  2 ปีที่แล้ว

      Seems like very specific problem. You can use String.SubString() method to get that particular part if the first part of the string is fixed. Please check out different things that you can do with substrings below.
      www.c-sharpcorner.com/UploadFile/mahesh/substring-in-C-Sharp/