B4J Question [Resolved] I need to select a text or a part of it by passing the search string - ivanomonti    Mar 16, 2023 I need to select a text or a part of it by passing the search string
example: I'm going to my...: I'm going and mom (textarea)
Dim value() As String = Regex.Split(" ",lb.Text)
Dim s,e As Int
Log(value(0))
Log(value(value.Length-1))
s=ta.Text.LastIndexOf(value(0))
e=ta.Text.LastIndexOf(value(value.Length-1))
ta.SetSelection(s,e)
Result
140312
Thank 1000... Share My Creation Open a text file with any extension - Sergey_New    Apr 11, 2025   (6 reactions) ) n=uri.LastIndexOf("/") filename=uri.SubString(n+1) uri=uri.SubString2(0,n) n=uri.LastIndexOf("/") folder=uri.SubString(n+1) After that, do whatever... and file names, you need to normalize the URI: Dim folder,filename As String Dim n... B4A Code Snippet FileUtil SUBs - DonManfred    Mar 27, 2014   (7 reactions) SubName: GetFilename Description: Gets the Filename of Image or Page from Path Sub GetFilename(fullpath As String) As String Return fullpath.SubString(fullpath.LastIndexOf("/") + 1) End Sub ' ' Example Log(GetFilename("http://www.domain.tld/SomePage.html")) ' -> SomePage.html Tags: Filenames GetFilename... B4A Library [B4X] BCTextEngine / BBCodeView - Text engine + BBCode parser + Rich Text View - Erel    Dec 31, 2024   (72 reactions)   tags: Label BBCode, text style, RTF component, B4X, ritchtext, rich text issue where setting BBLabel.Text to an empty string didn't remove the text. - v1.71 - New Font tag... platform library with several features: - Text drawing engine. - Text layout engine. - BBCode.../android/forum/threads/b4x-bbscrollinglabel-rich-text-scrolling-label.114310/ https://www.b4x.com... related to text. You can for example use it as an alternative to CSBuilder where you have more control over the text drawing. I will explain the main use case of BBCodeView. Our layout is usually made... Italian [RISOLTO] B4J - Estensione file e muovere un file - Elric (first post)    Mar 29, 2024   (1 reaction) Io mi sono fatto questi snippets: Public Sub GetDir (Path As String) As String If Path.Contains("\") Then Return Path.SubString2(0,Path.LastIndexOf("\")) Else....Contains("\") Then Return Path.SubString(Path.LastIndexOf("\") + 1....SubString2(Path.LastIndexOf("\") + 1, Path.LastIndexOf(".")) Else If (Not(Path....SubString(Path.LastIndexOf(".") + 1) Else Return "" End If End... B4A Question Work with substring - klaus (first post)    Jun 16, 2025   (3 reactions) Or like this: Private s As String = "https://www.test.com/mysite/test.html" Private i As Int Private r As String i = s.LastIndexOf("/") r = s.SubString(i + 1) Log(r)... B4A Question Get Text - Mahares (first post)    Dec 3, 2022   (1 reaction) Another way to do it not necessarily better: Dim username As String = "Username: user4eir7yhm" Log(username.SubString(username.LastIndexOf(" "))) Dim password As String = "Password: uh6r0cdh" Log(password.SubString(password.LastIndexOf(" "))) Edit: LastIndexOf(" ")) needs to be: LastIndexOf(" ")+1) to get rid of the space... B4A Question Get name of File from ContentChooser result? - Deleted member 103 (first post)    May 3, 2021   (1 reaction) choose file
Return UriString.SubString2(UriString.LastIndexOf("/")+3,UriString...("%3A") > -1 Then
Return UriString.SubString2(UriString.LastIndexOf("%3A"...
Return UriString.SubString2(UriString.LastIndexOf("/")+3,UriString.Length)
Else....LastIndexOf("/") + 1, UriString.Length)
else if UriString.StartsWith("content:"... B4A Question Decimal problem figures in euros! - WebQuest    Jul 24, 2020 is accepted. Thank you Lprezzo.Text=Prezzo1 If Lprezzo.Text.Length=3 Or Lprezzo.Text.Length=4 And Lprezzo.Text.LastIndexOf2(0,4)=0 Then If Lprezzo.Text.Length=3 Then If Lprezzo.Text.LastIndexOf2(0,3)=0 Or Lprezzo.Text.LastIndexOf2(0,4)=0 Then Lprezzo.Text=Prezzo1&".00€" Else Lprezzo.Text=Prezzo1&"0€" End If End If If Lprezzo.Text.Length=4 Then Lprezzo.Text... B4A Question Download and open a file from a password protected folder? - tsteward    Jan 26, 2025 *****" ' Replace with your actual password job.Download(url) Dim fname As String = url.SubString(url.LastIndexOf("/")+1) Log(fname) Wait For (job) JobDone(job... DownloadFile(url As String) Dim job As HttpJob job.Initialize("DownloadJob", Me... Page: 1   2   3   4   5   6   7   |