Remove All Space Characters In A String | C Programming Example

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ย. 2024

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

  • @walidoulondon8107
    @walidoulondon8107 ปีที่แล้ว +4

    Please keep uploading more problem solving in c I’m really enjoying your Chanel ❤

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

      I'm glad you're enjoying the channel! :-)

    • @walidoulondon8107
      @walidoulondon8107 ปีที่แล้ว

      @@PortfolioCourses do you have a Chanel about embedded systems and microcontroller?

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

    each time I visualize the video, I move forward "inches" in understanding the c programming. Thank you for making it such way.

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว

      You're welcome Naboulsi, I'm glad to hear you're moving forward in your understanding! :-)

  • @davidlandivar7710
    @davidlandivar7710 9 หลายเดือนก่อน

    seriously, you are the best. It's like you know what doubts I have and you prove stuff. ... plus your oration is grand. I can't stand all these Indian accents floating around on these subjects. Are they all programmers? I thought they were all doctors.

  • @Mini_Wolf.
    @Mini_Wolf. 5 หลายเดือนก่อน

    Ty, really useful

  • @preethichintam5239
    @preethichintam5239 ปีที่แล้ว

    Thank you so much

  • @marccalis9444
    @marccalis9444 ปีที่แล้ว

    Hi Kevin, NIce!
    Here is my version, with pointers:
    #include
    #include
    char *remove_spaces(char *string);
    int main(void)
    {
    char string[] = " \tA string with\t\twhitespaces in
    it
    ";
    printf("Before: '%s'", string);
    printf("
    After: '%s'
    ", remove_spaces(string));
    return 0;
    }
    char *remove_spaces(char *string)
    {
    char *string_base = string, *string_reader = string;
    while (*string_reader != '\0')
    {
    if (!isspace(*string_reader))
    *string++ = *string_reader;
    ++string_reader;
    }
    *string = '\0';
    return string_base;
    }

  • @decibi2684
    @decibi2684 ปีที่แล้ว

    Your videos so helpful for me. Could you make video on how to remove consecutive white spaces (i,e replace a multiple white spaces with single space in a string ) ?

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว

      Yes I can, that's a great idea for a video, I just posted it here: th-cam.com/video/liwJ3Gr-6z0/w-d-xo.html. :-)

    • @decibi2684
      @decibi2684 ปีที่แล้ว

      @@PortfolioCourses Thank you for posting the video so quickly. Asusual code is simple and clean.

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว

      @@decibi2684 You're welcome! 🙂

  • @walidoulondon8107
    @walidoulondon8107 ปีที่แล้ว

    Please can you do time in word program using string pointers to characters it’s in hacker rank website 😢

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

      Is it this problem? www.geeksforgeeks.org/convert-given-time-words/ Maybe I can cover it one day. :-)

    • @walidoulondon8107
      @walidoulondon8107 ปีที่แล้ว

      @@PortfolioCourses yes but I need the function return string not void .thanks

  • @dimitrioskalfakis
    @dimitrioskalfakis ปีที่แล้ว

    neat ;-)