Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let content: String = " \\UI\\Icon\\stone\\31001.dds {#ffffd052=Н±Т#} {#ffffd052=Н±Т#} {#ffffd052=Н±Т#}
- Ќ# , > и Ђ? яя …ы яяя UI".to_string();
- let chars = content.chars();
- let mut t: Vec<String> = Vec::new();
- let mut temp: String = String::new();
- let mut last_chars = '\0';
- for ch in chars{
- if get_chars(ch.clone()){ //println!("!");
- if last_chars == 'U' && ch == 'I'{
- let count = temp.chars().count();
- temp.remove(count - 1 );
- temp.remove(count - 2 );
- t.push(temp.clone());
- temp = String::new();
- temp.push('U');
- temp.push('I');
- } else {
- temp.push(ch);
- }
- last_chars = ch;
- }
- } t.push(temp);
- println!("{:?}", t);
- }
- fn get_chars(ch: char)->bool{
- let s: String = "qQwWeErRtTyYuUiIoOpP[{]}aAsSdDfFgGhHjJkKlL;:'\"zZxXcCvVbBnNmM,<.>/?\\`~1234567890"
- .to_string();
- for char_ in s.chars(){
- if ch == char_ { return true; }
- }
- false
- }
Add Comment
Please, Sign In to add comment