Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > How to split string?

Forum

Search UsersRules
How to split string?
#1
Active user
Points:: 0
Joined:: Feb 26, 2015

hi,

mystring="a@b@c@d";

//split code ??????

myarray[1]="a";
myarray[2]="b";
myarray[3]="c";
myarray[4]="d";

myarraylength= //length ??

Profile
#2
Active user
Points:: 0
Joined:: Nov 19, 2012

StrSplit
Syntax:

StrSplit(<String>, <Separator>, <IncludeBlank>)
Parameters:

<String> (required)

Type: String.
Separated string.
<Separator> (required)

Type: String.
Character string where every character is an individual delimiter.
<IncludeBlank> (optional)

Type: Boolean.
Shows if it is required to include the empty strings which can result from a separation of a source string while calculating the result.
Default value: True.
Returned value:

Type: Array.
Array with strings resulting from splitting of the source string.
Description:

Splits a string into parts according using the specified delimiter.

Availability:

Thin client, web-client, server, thick client, external connection, Mobile application (client), Mobile application (server).
See also:

Global context, method StrConcat

Profile
#3
Interested
Points:: 0
Joined:: Nov 10, 2011

Hello!

It is very strange but when I try

Code
&AtServer
Procedure SomeProcedure()
SomeTring = "HEllo World";
SplittedString = StrSplit(SomeString, "H", TRUE)

EndProcedure



I get an Error "Procedure or function with this name was not defined".

What's wrong?

Thank you for any advice!

Profile
#4
Active user
Points:: 0
Joined:: Apr 18, 2012

Hello, Lioudmila.

Function "StrSplit" provided since version 8.3.6.



@Admins There is a mistake in the function name in the file V8Update.htm.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.