Categories
Medium Problems

โจทย์ข้อที่ MX0026

จงเขียนฟังก์ชั่น ที่รับ string ที่แบ่งเป็น 2 ส่วน พร้อมตัวเชื่อม แล้วส่ง string ตัวใหม่ออกมาที่เกิดจากการเอา string 2 ส่วนมาเชื่อมกันด้วยตัวเชื่อม ถ้าตัวเชื่อมเป็น empty string หรือ null ให้เชื่อมด้วย empty string แทน

Examples

joinpath(“portion1″,”=”,”portion2″) ➞ “portion1=portion2”

joinpath(“portion1″,””,”portion2″) ➞ “portion1portion2”

Leave a Reply