Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private s As String
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage") 'has button1
s= File.ReadString(File.DirAssets, "darkwolf.txt") 'suppose you have a text file in assets folder
End Sub
Private Sub Button1_Click
s=s.Replace("DarkWolfalpha", "LightWolfbeta") 'you want to replace DarkWolfalpha with LightWolfbeta
File.WriteString(File.DirInternal, "lightwolf.txt", s) 'you cannot save it back to assets folder.because assets is read only
Log(File.ReadString(File.DirInternal, "lightwolf.txt")) 'shows you the new file with the changes
End Sub