WeixiangYan/CodeTransOcean huggingface dataset:
Task: Remove vowels from a string

C: #include <stdio.h>

void print_no_vowels(const char *s) {
    for (; *s != 0; s++) {
        switch (*s) {
        case 'A':
        case 'E':
        case 'I':
        case 'O':
        case 'U':
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
            break;
        default:
            putchar(*s);
            break;
        }
    }
}

void test(const char *const s) {
    printf("Input  : %s\n", s);

    printf("Output : ");
    print_no_vowels(s);
    printf("\n");
}

int main() {
    test("C Programming Language");
    return 0;
}











Ada: with Ada.Text_IO;           use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;

procedure Main is
   subtype Vowel is Character with
        Static_Predicate => Vowel in 'A' | 'E' | 'I' | 'O' | 'U' | 'a' | 'e' |
            'i' | 'o' | 'u';

   function Remove_Vowels (S : in String) return String is
      Temp : Unbounded_String;
   begin
      for C of S loop
         if C not in Vowel then
            Append (Source => Temp, New_Item => C);
         end if;
      end loop;
      return To_String (Temp);
   end Remove_Vowels;

   S1  : String := "The Quick Brown Fox Jumped Over the Lazy Dog's Back";
   S2  : String := "DON'T SCREAM AT ME!!";
   NV1 : String := Remove_Vowels (S1);
   NV2 : String := Remove_Vowels (S2);
begin
   Put_Line (S1);
   Put_Line (NV1);
   New_Line;
   Put_Line (S2);
   Put_Line (NV2);
end Main;
Task: Remove vowels from a string


C++: #include <algorithm>
#include <iostream>

class print_no_vowels {
private:
    const std::string &str;
public:
    print_no_vowels(const std::string &s) : str(s) {}
    friend std::ostream &operator<<(std::ostream &, print_no_vowels);
};

std::ostream &operator<<(std::ostream &os, print_no_vowels pnv) {
    auto it = pnv.str.cbegin();
    auto end = pnv.str.cend();
    std::for_each(
        it, end,
        [&os](char c) {
            switch (c) {
            case 'A':
            case 'E':
            case 'I':
            case 'O':
            case 'U':
            case 'a':
            case 'e':
            case 'i':
            case 'o':
            case 'u':
                break;
            default:
                os << c;
                break;
            }
        }
    );
    return os;
}

void test(const std::string &s) {
    std::cout << "Input  : " << s << '\n';
    std::cout << "Output : " << print_no_vowels(s) << '\n';
}

int main() {
    test("C++ Programming Language");
    return 0;
}










Ada: with Ada.Text_IO;           use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;

procedure Main is
   subtype Vowel is Character with
        Static_Predicate => Vowel in 'A' | 'E' | 'I' | 'O' | 'U' | 'a' | 'e' |
            'i' | 'o' | 'u';

   function Remove_Vowels (S : in String) return String is
      Temp : Unbounded_String;
   begin
      for C of S loop
         if C not in Vowel then
            Append (Source => Temp, New_Item => C);
         end if;
      end loop;
      return To_String (Temp);
   end Remove_Vowels;

   S1  : String := "The Quick Brown Fox Jumped Over the Lazy Dog's Back";
   S2  : String := "DON'T SCREAM AT ME!!";
   NV1 : String := Remove_Vowels (S1);
   NV2 : String := Remove_Vowels (S2);
begin
   Put_Line (S1);
   Put_Line (NV1);
   New_Line;
   Put_Line (S2);
   Put_Line (NV2);
end Main;
Task: Remove vowels from a string




Go: package main

import (
    "fmt"
    "strings"
)

func removeVowels(s string) string {
    var sb strings.Builder
    vowels := "aeiouAEIOU"
    for _, c := range s {
        if !strings.ContainsAny(string(c), vowels) {
            sb.WriteRune(c)
        }
    }
    return sb.String()
}

func main() {
    s := "Go Programming Language"
    fmt.Println("Input  :", s)
    fmt.Println("Output :", removeVowels(s))
}








Ada: with Ada.Text_IO;           use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;

procedure Main is
   subtype Vowel is Character with
        Static_Predicate => Vowel in 'A' | 'E' | 'I' | 'O' | 'U' | 'a' | 'e' |
            'i' | 'o' | 'u';

   function Remove_Vowels (S : in String) return String is
      Temp : Unbounded_String;
   begin
      for C of S loop
         if C not in Vowel then
            Append (Source => Temp, New_Item => C);
         end if;
      end loop;
      return To_String (Temp);
   end Remove_Vowels;

   S1  : String := "The Quick Brown Fox Jumped Over the Lazy Dog's Back";
   S2  : String := "DON'T SCREAM AT ME!!";
   NV1 : String := Remove_Vowels (S1);
   NV2 : String := Remove_Vowels (S2);
begin
   Put_Line (S1);
   Put_Line (NV1);
   New_Line;
   Put_Line (S2);
   Put_Line (NV2);
end Main;
Task: Remove vowels from a string





Java: public static String removeVowelse(String str){
    String re = "";
    char c;
    for(int x = 0; x<str.length(); x++){
        c = str.charAt(x);
        if(!(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'))
        re+=c;
    }
    return re;
}







Ada: with Ada.Text_IO;           use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;

procedure Main is
   subtype Vowel is Character with
        Static_Predicate => Vowel in 'A' | 'E' | 'I' | 'O' | 'U' | 'a' | 'e' |
            'i' | 'o' | 'u';

   function Remove_Vowels (S : in String) return String is
      Temp : Unbounded_String;
   begin
      for C of S loop
         if C not in Vowel then
            Append (Source => Temp, New_Item => C);
         end if;
      end loop;
      return To_String (Temp);
   end Remove_Vowels;

   S1  : String := "The Quick Brown Fox Jumped Over the Lazy Dog's Back";
   S2  : String := "DON'T SCREAM AT ME!!";
   NV1 : String := Remove_Vowels (S1);
   NV2 : String := Remove_Vowels (S2);
begin
   Put_Line (S1);
   Put_Line (NV1);
   New_Line;
   Put_Line (S2);
   Put_Line (NV2);
end Main;
Task: Remove vowels from a string







Python: 



def exceptGlyphs(exclusions):
    
    def go(s):
        return ''.join(
            c for c in s if c not in exclusions
        )
    return go




def main():
    

    txt = 

    print(
        exceptGlyphs('eau')(txt)
    )



if __name__ == '__main__':
    main()





Ada: with Ada.Text_IO;           use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;

procedure Main is
   subtype Vowel is Character with
        Static_Predicate => Vowel in 'A' | 'E' | 'I' | 'O' | 'U' | 'a' | 'e' |
            'i' | 'o' | 'u';

   function Remove_Vowels (S : in String) return String is
      Temp : Unbounded_String;
   begin
      for C of S loop
         if C not in Vowel then
            Append (Source => Temp, New_Item => C);
         end if;
      end loop;
      return To_String (Temp);
   end Remove_Vowels;

   S1  : String := "The Quick Brown Fox Jumped Over the Lazy Dog's Back";
   S2  : String := "DON'T SCREAM AT ME!!";
   NV1 : String := Remove_Vowels (S1);
   NV2 : String := Remove_Vowels (S2);
begin
   Put_Line (S1);
   Put_Line (NV1);
   New_Line;
   Put_Line (S2);
   Put_Line (NV2);
end Main;
Task: Remove vowels from a string








VB: Imports System.Text

Module Module1

    Function RemoveVowels(s As String) As String
        Dim sb As New StringBuilder
        For Each c In s
            Select Case c
                Case "A", "a"
                Case "E", "e"
                Case "I", "i"
                Case "O", "o"
                Case "U", "u"
                    Exit Select
                Case Else
                    sb.Append(c)
            End Select
        Next
        Return sb.ToString
    End Function

    Sub Test(s As String)
        Console.WriteLine("Input  : {0}", s)
        Console.WriteLine("Output : {0}", RemoveVowels(s))
    End Sub

    Sub Main()
        Test("Visual Basic .NET")
    End Sub

End Module




Ada: with Ada.Text_IO;           use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;

procedure Main is
   subtype Vowel is Character with
        Static_Predicate => Vowel in 'A' | 'E' | 'I' | 'O' | 'U' | 'a' | 'e' |
            'i' | 'o' | 'u';

   function Remove_Vowels (S : in String) return String is
      Temp : Unbounded_String;
   begin
      for C of S loop
         if C not in Vowel then
            Append (Source => Temp, New_Item => C);
         end if;
      end loop;
      return To_String (Temp);
   end Remove_Vowels;

   S1  : String := "The Quick Brown Fox Jumped Over the Lazy Dog's Back";
   S2  : String := "DON'T SCREAM AT ME!!";
   NV1 : String := Remove_Vowels (S1);
   NV2 : String := Remove_Vowels (S2);
begin
   Put_Line (S1);
   Put_Line (NV1);
   New_Line;
   Put_Line (S2);
   Put_Line (NV2);
end Main;
Task: Remove vowels from a string

C: #include <stdio.h>

void print_no_vowels(const char *s) {
    for (; *s != 0; s++) {
        switch (*s) {
        case 'A':
        case 'E':
        case 'I':
        case 'O':
        case 'U':
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
            break;
        default:
            putchar(*s);
            break;
        }
    }
}

void test(const char *const s) {
    printf("Input  : %s\n", s);

    printf("Output : ");
    print_no_vowels(s);
    printf("\n");
}

int main() {
    test("C Programming Language");
    return 0;
}
Task: Remove vowels from a string



C#: static string remove_vowels(string value)
{
    var stripped = from c in value.ToCharArray()
                   where !"aeiouAEIOU".Contains(c)
                   select c;

    return new string(stripped.ToArray());
}

static void test(string value)
{
    Console.WriteLine("Input:  " + value);
    Console.WriteLine("Output: " + remove_vowels(value));
}

static void Main(string[] args)
{
    test("CSharp Programming Language");
}
Task: Remove vowels from a string


C++: #include <algorithm>
#include <iostream>

class print_no_vowels {
private:
    const std::string &str;
public:
    print_no_vowels(const std::string &s) : str(s) {}
    friend std::ostream &operator<<(std::ostream &, print_no_vowels);
};

std::ostream &operator<<(std::ostream &os, print_no_vowels pnv) {
    auto it = pnv.str.cbegin();
    auto end = pnv.str.cend();
    std::for_each(
        it, end,
        [&os](char c) {
            switch (c) {
            case 'A':
            case 'E':
            case 'I':
            case 'O':
            case 'U':
            case 'a':
            case 'e':
            case 'i':
            case 'o':
            case 'u':
                break;
            default:
                os << c;
                break;
            }
        }
    );
    return os;
}

void test(const std::string &s) {
    std::cout << "Input  : " << s << '\n';
    std::cout << "Output : " << print_no_vowels(s) << '\n';
}

int main() {
    test("C++ Programming Language");
    return 0;
}
Task: Remove vowels from a string





Java: public static String removeVowelse(String str){
    String re = "";
    char c;
    for(int x = 0; x<str.length(); x++){
        c = str.charAt(x);
        if(!(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'))
        re+=c;
    }
    return re;
}
Task: Remove vowels from a string







Python: 



def exceptGlyphs(exclusions):
    
    def go(s):
        return ''.join(
            c for c in s if c not in exclusions
        )
    return go




def main():
    

    txt = 

    print(
        exceptGlyphs('eau')(txt)
    )



if __name__ == '__main__':
    main()
Task: Remove vowels from a string








VB: Imports System.Text

Module Module1

    Function RemoveVowels(s As String) As String
        Dim sb As New StringBuilder
        For Each c In s
            Select Case c
                Case "A", "a"
                Case "E", "e"
                Case "I", "i"
                Case "O", "o"
                Case "U", "u"
                    Exit Select
                Case Else
                    sb.Append(c)
            End Select
        Next
        Return sb.ToString
    End Function

    Sub Test(s As String)
        Console.WriteLine("Input  : {0}", s)
        Console.WriteLine("Output : {0}", RemoveVowels(s))
    End Sub

    Sub Main()
        Test("Visual Basic .NET")
    End Sub

End Module
Task: Remove vowels from a string




Go: package main

import (
    "fmt"
    "strings"
)

func removeVowels(s string) string {
    var sb strings.Builder
    vowels := "aeiouAEIOU"
    for _, c := range s {
        if !strings.ContainsAny(string(c), vowels) {
            sb.WriteRune(c)
        }
    }
    return sb.String()
}

func main() {
    s := "Go Programming Language"
    fmt.Println("Input  :", s)
    fmt.Println("Output :", removeVowels(s))
}
Task: Remove vowels from a string



C#: static string remove_vowels(string value)
{
    var stripped = from c in value.ToCharArray()
                   where !"aeiouAEIOU".Contains(c)
                   select c;

    return new string(stripped.ToArray());
}

static void test(string value)
{
    Console.WriteLine("Input:  " + value);
    Console.WriteLine("Output: " + remove_vowels(value));
}

static void Main(string[] args)
{
    test("CSharp Programming Language");
}








Fortran: program remove_vowels
    implicit none

    character(len=*), parameter :: string1="The quick brown fox jumps over the lazy dog."
    character(len=*), parameter :: string2="Fortran programming language"

    call print_no_vowels(string1)
    call print_no_vowels(string2)
contains
    subroutine print_no_vowels(string)
        character(len=*), intent(in)    :: string
        integer                         :: i

        do i = 1, len(string)
            select case (string(i:i))
            case('A','E','I','O','U','a','e','i','o','u')
                cycle
            case default
                write(*,'(A1)',advance="no") string(i:i)
            end select
        end do
        write(*,*) new_line('A') 
    end subroutine print_no_vowels
end program remove_vowels
Task: Remove vowels from a string


C++: #include <algorithm>
#include <iostream>

class print_no_vowels {
private:
    const std::string &str;
public:
    print_no_vowels(const std::string &s) : str(s) {}
    friend std::ostream &operator<<(std::ostream &, print_no_vowels);
};

std::ostream &operator<<(std::ostream &os, print_no_vowels pnv) {
    auto it = pnv.str.cbegin();
    auto end = pnv.str.cend();
    std::for_each(
        it, end,
        [&os](char c) {
            switch (c) {
            case 'A':
            case 'E':
            case 'I':
            case 'O':
            case 'U':
            case 'a':
            case 'e':
            case 'i':
            case 'o':
            case 'u':
                break;
            default:
                os << c;
                break;
            }
        }
    );
    return os;
}

void test(const std::string &s) {
    std::cout << "Input  : " << s << '\n';
    std::cout << "Output : " << print_no_vowels(s) << '\n';
}

int main() {
    test("C++ Programming Language");
    return 0;
}









Fortran: program remove_vowels
    implicit none

    character(len=*), parameter :: string1="The quick brown fox jumps over the lazy dog."
    character(len=*), parameter :: string2="Fortran programming language"

    call print_no_vowels(string1)
    call print_no_vowels(string2)
contains
    subroutine print_no_vowels(string)
        character(len=*), intent(in)    :: string
        integer                         :: i

        do i = 1, len(string)
            select case (string(i:i))
            case('A','E','I','O','U','a','e','i','o','u')
                cycle
            case default
                write(*,'(A1)',advance="no") string(i:i)
            end select
        end do
        write(*,*) new_line('A') 
    end subroutine print_no_vowels
end program remove_vowels
Task: Remove vowels from a string

C: #include <stdio.h>

void print_no_vowels(const char *s) {
    for (; *s != 0; s++) {
        switch (*s) {
        case 'A':
        case 'E':
        case 'I':
        case 'O':
        case 'U':
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
            break;
        default:
            putchar(*s);
            break;
        }
    }
}

void test(const char *const s) {
    printf("Input  : %s\n", s);

    printf("Output : ");
    print_no_vowels(s);
    printf("\n");
}

int main() {
    test("C Programming Language");
    return 0;
}










Fortran: program remove_vowels
    implicit none

    character(len=*), parameter :: string1="The quick brown fox jumps over the lazy dog."
    character(len=*), parameter :: string2="Fortran programming language"

    call print_no_vowels(string1)
    call print_no_vowels(string2)
contains
    subroutine print_no_vowels(string)
        character(len=*), intent(in)    :: string
        integer                         :: i

        do i = 1, len(string)
            select case (string(i:i))
            case('A','E','I','O','U','a','e','i','o','u')
                cycle
            case default
                write(*,'(A1)',advance="no") string(i:i)
            end select
        end do
        write(*,*) new_line('A') 
    end subroutine print_no_vowels
end program remove_vowels
Task: Remove vowels from a string




Go: package main

import (
    "fmt"
    "strings"
)

func removeVowels(s string) string {
    var sb strings.Builder
    vowels := "aeiouAEIOU"
    for _, c := range s {
        if !strings.ContainsAny(string(c), vowels) {
            sb.WriteRune(c)
        }
    }
    return sb.String()
}

func main() {
    s := "Go Programming Language"
    fmt.Println("Input  :", s)
    fmt.Println("Output :", removeVowels(s))
}







Fortran: program remove_vowels
    implicit none

    character(len=*), parameter :: string1="The quick brown fox jumps over the lazy dog."
    character(len=*), parameter :: string2="Fortran programming language"

    call print_no_vowels(string1)
    call print_no_vowels(string2)
contains
    subroutine print_no_vowels(string)
        character(len=*), intent(in)    :: string
        integer                         :: i

        do i = 1, len(string)
            select case (string(i:i))
            case('A','E','I','O','U','a','e','i','o','u')
                cycle
            case default
                write(*,'(A1)',advance="no") string(i:i)
            end select
        end do
        write(*,*) new_line('A') 
    end subroutine print_no_vowels
end program remove_vowels
Task: Remove vowels from a string





Java: public static String removeVowelse(String str){
    String re = "";
    char c;
    for(int x = 0; x<str.length(); x++){
        c = str.charAt(x);
        if(!(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'))
        re+=c;
    }
    return re;
}






Fortran: program remove_vowels
    implicit none

    character(len=*), parameter :: string1="The quick brown fox jumps over the lazy dog."
    character(len=*), parameter :: string2="Fortran programming language"

    call print_no_vowels(string1)
    call print_no_vowels(string2)
contains
    subroutine print_no_vowels(string)
        character(len=*), intent(in)    :: string
        integer                         :: i

        do i = 1, len(string)
            select case (string(i:i))
            case('A','E','I','O','U','a','e','i','o','u')
                cycle
            case default
                write(*,'(A1)',advance="no") string(i:i)
            end select
        end do
        write(*,*) new_line('A') 
    end subroutine print_no_vowels
end program remove_vowels
Task: Remove vowels from a string







Python: 



def exceptGlyphs(exclusions):
    
    def go(s):
        return ''.join(
            c for c in s if c not in exclusions
        )
    return go




def main():
    

    txt = 

    print(
        exceptGlyphs('eau')(txt)
    )



if __name__ == '__main__':
    main()




Fortran: program remove_vowels
    implicit none

    character(len=*), parameter :: string1="The quick brown fox jumps over the lazy dog."
    character(len=*), parameter :: string2="Fortran programming language"

    call print_no_vowels(string1)
    call print_no_vowels(string2)
contains
    subroutine print_no_vowels(string)
        character(len=*), intent(in)    :: string
        integer                         :: i

        do i = 1, len(string)
            select case (string(i:i))
            case('A','E','I','O','U','a','e','i','o','u')
                cycle
            case default
                write(*,'(A1)',advance="no") string(i:i)
            end select
        end do
        write(*,*) new_line('A') 
    end subroutine print_no_vowels
end program remove_vowels
Task: Remove vowels from a string








VB: Imports System.Text

Module Module1

    Function RemoveVowels(s As String) As String
        Dim sb As New StringBuilder
        For Each c In s
            Select Case c
                Case "A", "a"
                Case "E", "e"
                Case "I", "i"
                Case "O", "o"
                Case "U", "u"
                    Exit Select
                Case Else
                    sb.Append(c)
            End Select
        Next
        Return sb.ToString
    End Function

    Sub Test(s As String)
        Console.WriteLine("Input  : {0}", s)
        Console.WriteLine("Output : {0}", RemoveVowels(s))
    End Sub

    Sub Main()
        Test("Visual Basic .NET")
    End Sub

End Module



Fortran: program remove_vowels
    implicit none

    character(len=*), parameter :: string1="The quick brown fox jumps over the lazy dog."
    character(len=*), parameter :: string2="Fortran programming language"

    call print_no_vowels(string1)
    call print_no_vowels(string2)
contains
    subroutine print_no_vowels(string)
        character(len=*), intent(in)    :: string
        integer                         :: i

        do i = 1, len(string)
            select case (string(i:i))
            case('A','E','I','O','U','a','e','i','o','u')
                cycle
            case default
                write(*,'(A1)',advance="no") string(i:i)
            end select
        end do
        write(*,*) new_line('A') 
    end subroutine print_no_vowels
end program remove_vowels