Visualizzazione dei risultati da 1 a 10 su 11

Visualizzazione discussione

  1. #5
    Utente di HTML.it L'avatar di escocat
    Registrato dal
    Feb 2012
    Messaggi
    308
    ....insomma proprio il suo dovere no.... la riga § mi compare alla fine della finestra non all'inizio....

    codice:
           public static string Mid(string a, int x, int l)
            {
                if (x - 1 + l > a.Length) 
                    return a.Substring(x - 1, a.Length - x + 1);
                else
                    return a.Substring(x - 1, l);
            }  
                                                                                                    
            public static int Instr(string a, string b, int x)
            {
                for (int k = x; k < a.Length + 1; k++)
                {
                    if (Mid(a, k, b.Length) == b)
                        return k;
                }
                return 0;
            }                                                                                                                                                                                               
                              
            
            string file = "ciao.txt";
            string r = File.ReadAllText(file);
            int z = Instr(r, "§", 1);
            textBox1.SelectionStart = z;
            textBox1.ScrollToCaret();
            textBox1.Focus();
            textBox1.DeselectAll();
    Ultima modifica di escocat; 08-12-2013 a 15:34

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.