Table of Contents

Property SearchLen

Namespace
Alternet.Editor.Wpf
Assembly
Alternet.Editor.Wpf.v9.dll

SearchLen

Represents length of the last found text.

[Browsable(false)]
public virtual int SearchLen { get; }

Property Value

int

Examples

Here is how to use a SearchLen in the C# code:

public partial class MainWindow : Window
{
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var textEditor = new Alternet.Editor.Wpf.TextEditor();
        textEditor.LoadFile("myfile.txt");
        if (textEditor.Find("my text"))
        {
            System.Windows.MessageBox.Show(string.Format("Found text length: {0}", textEditor.SearchLen));
        }
    }
}

Here is how to use a SearchLen in the Visual Basic code:

Partial Public Class MainWindow

    Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim textEditor = New Alternet.Editor.Wpf.TextEditor()
        textEditor.LoadFile("myfile.txt")

        If textEditor.Find("my text") Then
            System.Windows.MessageBox.Show(String.Format("Found text length: {0}", textEditor.SearchLen))
        End If
    End Sub
End Class

Remarks

You can use this property to determine the length of the text fragment found by the last search operation before performing operations on the found text.