pub fn uwuify_str(input: &str) -> String
Expand description

A rust-optimized version of:

/// Taken from: https://honk.moe/tools/owo.html
var faces = ["(・`ω´・)", ";;w;;", "owo", "UwU", ">w<", "^w^"];
function OwoifyText(){
    v = document.getElementById("textarea").value
    v = v.replace(/(?:r|l)/g, "w");
    v = v.replace(/(?:R|L)/g, "W");
    v = v.replace(/n([aeiou])/g, 'ny$1');
    v = v.replace(/N([aeiou])/g, 'Ny$1');
    v = v.replace(/N([AEIOU])/g, 'Ny$1');
    v = v.replace(/ove/g, "uv");
    v = v.replace(/\!+/g, " " + faces[Math.floor(Math.random() * faces.length)] + " ");
    document.getElementById("textarea").value = v
 };

This version doesn’t use regexes and completes the uwufication in 1 iteration with a lookahead buffer of 2 elements. NOTE: It may be buggy due to its complexity and discrepancies with the js version should be reported on the issue tracker.