Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sobot_module_Dev
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sobot_android
Sobot_module_Dev
Commits
778b97a5
Commit
778b97a5
authored
Aug 11, 2023
by
zhengnw@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
空字符判断
parent
1b1f0403
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
sobot-utils-publish-mavencentral.gradle
sobot_utils/sobot-utils-publish-mavencentral.gradle
+1
-1
SobotStringUtils.java
...utils/src/main/java/com/sobot/utils/SobotStringUtils.java
+20
-0
No files found.
sobot_utils/sobot-utils-publish-mavencentral.gradle
View file @
778b97a5
...
...
@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext
{
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'utils'
//项目名
PUBLISH_VERSION
=
'1.1.
1
'
//版本号
PUBLISH_VERSION
=
'1.1.
2
'
//版本号
}
...
...
sobot_utils/src/main/java/com/sobot/utils/SobotStringUtils.java
View file @
778b97a5
package
com
.
sobot
.
utils
;
import
android.text.TextUtils
;
import
java.io.UnsupportedEncodingException
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -19,6 +21,24 @@ public final class SobotStringUtils {
return
(
str
==
null
||
""
.
equals
(
str
)
||
"null"
.
equals
(
str
));
}
//检查字符串是否为空
public
static
boolean
isEmpty
(
String
str
)
{
if
(
TextUtils
.
isEmpty
(
str
)
||
"null"
.
equals
(
str
)
||
"NULL"
.
equals
(
str
))
{
return
true
;
}
else
{
return
false
;
}
}
//检查字符串为空的情况,如果是空,返回 “”
public
static
String
checkStringIsNull
(
String
str
)
{
if
(
TextUtils
.
isEmpty
(
str
)
||
"null"
.
equals
(
str
)
||
"NULL"
.
equals
(
str
))
{
return
""
;
}
else
{
return
str
;
}
}
/**
* null 转为空字符串
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment