C #-2. Continue writing the method in this class, named reconvert, with one parameter, but it can be a string, integer, single precision, double precision. The method function returns the reverse order of parameters.

Source: Internet
Author: User
Using system; using system. collections. generic; using system. LINQ; using system. text; namespace the_experiment _ of _ Three _ week {class program {static void main (string [] ARGs) {myclass M = new myclass (); int T1 = m. countchar ("dsfagaasdsfafa",'s '); console. writeline (T1); M. reconvert ("dsfagaasdsfafa"); console. readkey () ;}} class myclass {public int countchar (string S, char c) {char [] STR = new char [322]; STR = S. tochararray (); int T = 0; For (INT I = 0; I <Str. length; I ++) {If (STR [I] = c) {T ++ ;}} return t;} public void reconvert (string S) {char [] Sr = S. tochararray (); char [] SR1 = new char [100]; Int J = sr. length-1; for (INT I = 0; I <Sr. length; I ++) {SR1 [J] = Sr [I]; j --;} foreach (char L in SR1) {console. write (l );}}}}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.