Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pattern matching on String in Rust Language

Tags:

string

rust

Is possible to parse the <path> part from GET /<path> HTTP/1.1 using pattern matching, or anything gracefully rather than direct string manipulation such as split or slice

like image 252
Yuan Wang Avatar asked Feb 18 '14 04:02

Yuan Wang


1 Answers

No. Pattern matching does not do partial string matching. Splitting and slicing and iterating are the only ways you can get the contents of it.

like image 81
Chris Morgan Avatar answered Oct 06 '22 23:10

Chris Morgan