Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
ad8abfc4
Commit
ad8abfc4
authored
2 years ago
by
Robert Stone
Browse files
Options
Downloads
Patches
Plain Diff
Add custom string separators
parent
71baada7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1443
Android Auto: Play As Audio Fix and Code Clean-up
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/util/TextUtils.kt
+21
-4
21 additions, 4 deletions
...cation/vlc-android/src/org/videolan/vlc/util/TextUtils.kt
with
21 additions
and
4 deletions
application/vlc-android/src/org/videolan/vlc/util/TextUtils.kt
+
21
−
4
View file @
ad8abfc4
...
...
@@ -38,18 +38,35 @@ object TextUtils {
* Create a string separated by the common [separator]
*
* @param pieces the strings to join
* @return a string containing all the [pieces] if they are not blanked, s
p
earated by the [separator]
* @return a string containing all the [pieces] if they are not blanked, se
p
arated by the [separator]
*/
@JvmName
(
"separatedStringArgs"
)
fun
separatedString
(
vararg
pieces
:
String
?)
=
separatedString
(
arrayOf
(*
pieces
))
fun
separatedString
(
vararg
pieces
:
String
?)
=
separatedString
(
this
.
separator
,
arrayOf
(*
pieces
))
/**
* Create a string separated by the common [separator]
*
* @param pieces the strings to join in an [Array]
* @return a string containing all the [pieces] if they are not blanked, s
p
earated by the [separator]
* @return a string containing all the [pieces] if they are not blanked, se
p
arated by the [separator]
*/
fun
separatedString
(
pieces
:
Array
<
String
?>)
=
pieces
.
filter
{
it
?.
isNotBlank
()
==
true
}.
joinToString
(
separator
=
" $separator "
)
fun
separatedString
(
pieces
:
Array
<
String
?>)
=
separatedString
(
this
.
separator
,
pieces
)
/**
* Create a string separated by a custom [separator]
*
* @param pieces the strings to join
* @return a string containing all the [pieces] if they are not blanked, separated by [separator]
*/
@JvmName
(
"separatedStringArgs"
)
fun
separatedString
(
separator
:
Char
,
vararg
pieces
:
String
?)
=
separatedString
(
separator
,
arrayOf
(*
pieces
))
/**
* Create a string separated by a custom [separator]
*
* @param pieces the strings to join in an [Array]
* @return a string containing all the [pieces] if they are not blanked, separated by [separator]
*/
fun
separatedString
(
separator
:
Char
,
pieces
:
Array
<
String
?>)
=
pieces
.
filter
{
it
?.
isNotBlank
()
==
true
}.
joinToString
(
separator
=
" $separator "
)
/**
* Formats the chapter title by prepending "Chapter:" if the current title is made of only non alpha chars
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment