From 56c4cdb95a8e9f16a04eb7a92ee5279c585c83cd Mon Sep 17 00:00:00 2001 From: narawat Date: Mon, 27 Apr 2026 14:42:47 +0700 Subject: [PATCH] update --- String_manipulation/julia/README.md | 36 +++++++++++++++ String_manipulation/julia/main.jl | 63 ++++++++++++++++++++++++++ String_manipulation/rust/.gitignore | 1 + String_manipulation/rust/Cargo.lock | 7 +++ String_manipulation/rust/README.md | 67 ++++++++++++++++++++++++++++ String_manipulation/rust/src/main.rs | 57 +++++++++++++++++++++++ 6 files changed, 231 insertions(+) create mode 100644 String_manipulation/julia/README.md create mode 100644 String_manipulation/rust/.gitignore create mode 100644 String_manipulation/rust/Cargo.lock create mode 100644 String_manipulation/rust/README.md diff --git a/String_manipulation/julia/README.md b/String_manipulation/julia/README.md new file mode 100644 index 0000000..a86eb71 --- /dev/null +++ b/String_manipulation/julia/README.md @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/String_manipulation/julia/main.jl b/String_manipulation/julia/main.jl index e69de29..5b6d0bd 100644 --- a/String_manipulation/julia/main.jl +++ b/String_manipulation/julia/main.jl @@ -0,0 +1,63 @@ +# Problem 3: String Manipulation +# Concepts: String vs &str, slicing, iteration + +# Count words in a string, ignoring punctuation: + +# Input: "Hello, world! How are you?" + +# Output: 5 + +# Also return vector of unique words (lowercase, no punctuation) +# ---------------------------------------------- 100 --------------------------------------------- # + +function main() + text = "Hello, world! How are you?" + text_list = split(text, " ") + println("$(length(text_list))") +end + + + +main() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/String_manipulation/rust/.gitignore b/String_manipulation/rust/.gitignore new file mode 100644 index 0000000..9f97022 --- /dev/null +++ b/String_manipulation/rust/.gitignore @@ -0,0 +1 @@ +target/ \ No newline at end of file diff --git a/String_manipulation/rust/Cargo.lock b/String_manipulation/rust/Cargo.lock new file mode 100644 index 0000000..b9d42e1 --- /dev/null +++ b/String_manipulation/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "rust" +version = "0.1.0" diff --git a/String_manipulation/rust/README.md b/String_manipulation/rust/README.md new file mode 100644 index 0000000..c357d5f --- /dev/null +++ b/String_manipulation/rust/README.md @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/String_manipulation/rust/src/main.rs b/String_manipulation/rust/src/main.rs index e7a11a9..ae709fa 100644 --- a/String_manipulation/rust/src/main.rs +++ b/String_manipulation/rust/src/main.rs @@ -1,3 +1,60 @@ +// Problem 3: String Manipulation +// Concepts: String vs &str, slicing, iteration + +// Count words in a string, ignoring punctuation: + +// Input: "Hello, world! How are you?" + +// Output: 5 + +// Also return vector of unique words (lowercase, no punctuation) +/* --------------------------------------------- 100 -------------------------------------------- */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fn main() { println!("Hello, world!"); }