Skip to content

Commit 5343063

Browse files
committed
trim string motif result
1 parent 7c8caf0 commit 5343063

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Library/base/base.vb

+11-3
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,16 @@ Public Module base
167167
<ExportAPI("string_motif")>
168168
Public Function string_motif(<RRawVectorArgument> x As Object,
169169
Optional threshold As Double = 0.3,
170-
Optional any As Char = "-"c) As Object
171-
172-
Return CommonTagParser.StringMotif(CLRVector.asCharacter(x), threshold, any)
170+
Optional any As Char = "-"c,
171+
Optional trim As Boolean = True) As Object
172+
173+
Dim motif As String = CommonTagParser.StringMotif(CLRVector.asCharacter(x), threshold, any)
174+
If trim Then
175+
motif = motif.Trim(any)
176+
motif = motif.Replace(any & any, any)
177+
motif = motif.Replace(any & any, any)
178+
motif = motif.Replace(any & any, any)
179+
End If
180+
Return motif
173181
End Function
174182
End Module

0 commit comments

Comments
 (0)